From 76325f718b6e4ad60cc5499324fb814641409851 Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Tue, 17 Sep 2024 15:36:18 +0200 Subject: [PATCH] fix(snapshot): migration wrong item ids --- packages/core/src/snapshot/migrate.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/core/src/snapshot/migrate.ts b/packages/core/src/snapshot/migrate.ts index dd1f062..e71deb7 100644 --- a/packages/core/src/snapshot/migrate.ts +++ b/packages/core/src/snapshot/migrate.ts @@ -21,7 +21,8 @@ export async function migrateSnapshotFolder(snapshotFolder: string) { const dataPerResource = new Map>() for (const file of files) { - const [resourceName, id] = file.split('/') + const [resourceName, filename] = file.split('/') + const id = path.basename(filename, '.json') const filePath = path.join(snapshotFolder, file) const content = await fs.promises.readFile(filePath, 'utf8') const fileData = SuperJSON.parse(content)