|
@@ -107,9 +107,10 @@ module.exports = (crowi) => {
|
|
|
// filter fileStats
|
|
// filter fileStats
|
|
|
const filteredFileStats = fileStats.filter(({ fileName, collectionName, size }) => { return collections.includes(collectionName) });
|
|
const filteredFileStats = fileStats.filter(({ fileName, collectionName, size }) => { return collections.includes(collectionName) });
|
|
|
|
|
|
|
|
- // TODO: validate using meta data
|
|
|
|
|
-
|
|
|
|
|
try {
|
|
try {
|
|
|
|
|
+ // validate with meta.json
|
|
|
|
|
+ importService.validate(meta);
|
|
|
|
|
+
|
|
|
await Promise.all(filteredFileStats.map(async({ fileName, collectionName, size }) => {
|
|
await Promise.all(filteredFileStats.map(async({ fileName, collectionName, size }) => {
|
|
|
const Model = importService.getModelFromCollectionName(collectionName);
|
|
const Model = importService.getModelFromCollectionName(collectionName);
|
|
|
const jsonFile = importService.getFile(fileName);
|
|
const jsonFile = importService.getFile(fileName);
|
|
@@ -140,6 +141,9 @@ module.exports = (crowi) => {
|
|
|
try {
|
|
try {
|
|
|
const data = await growiBridgeService.parseZipFile(zipFile);
|
|
const data = await growiBridgeService.parseZipFile(zipFile);
|
|
|
|
|
|
|
|
|
|
+ // validate with meta.json
|
|
|
|
|
+ importService.validate(data.meta);
|
|
|
|
|
+
|
|
|
// TODO: use res.apiv3
|
|
// TODO: use res.apiv3
|
|
|
return res.send({
|
|
return res.send({
|
|
|
ok: true,
|
|
ok: true,
|