Skip to content

Commit

Permalink
fix(data): warehouse id error
Browse files Browse the repository at this point in the history
  • Loading branch information
uiolee committed Aug 1, 2023
1 parent 4c0920d commit df9c53e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions scripts/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,16 @@ hexo.extend.filter.register('before_generate', async () => {
});
}
});
await Data.insert({
_id: type,
data: arr
});
if (Data.has(type)) {
await Data.replaceById(type, {
_id: type,
data: arr
});
} else {
await Data.insert({
_id: type,
data: arr
});
}
}
}, 0);

0 comments on commit df9c53e

Please sign in to comment.