Added the ability to import creatures from other instances of DiceCloud

This commit is contained in:
ThaumRystra
2024-09-03 22:54:44 +02:00
parent 2a3357ce5c
commit e11fb50103
11 changed files with 304 additions and 12 deletions

View File

@@ -0,0 +1,12 @@
import migrateProperty2To3 from '/imports/migrations/archive/properties/migrateProperty2To3';
export default function migrateApiCreature2To3(creature) {
creature.creatureProperties = creature.creatureProperties.map(prop => {
try {
migrateProperty2To3(prop);
} catch (e) {
console.warn('Property migration 2 -> 3 failed: ', { propId: prop._id, error: e.message || e.reason || e.toString() });
}
return prop;
});
}