Files
DiceCloud/app/imports/migrations/v1Migration/migrateCharacter.js
2021-09-27 13:44:43 +02:00

13 lines
404 B
JavaScript

import { fetch } from 'meteor/fetch'
export default function importCharacter(url){
// Using v1's JSON API to fetch the character data in a usable format
// url -> https://dicecloud.com/character/<id>/json?key=<key>
fetch(url)
.then(response => response.json())
.then(data => {
let character = data.characters[0];
console.log(character.name + ' fetched successfuly')
});
}