Skip to content

Commit 9cdd52c

Browse files
jonasclaesCopilot
andauthored
Update backend/pb_migrations/1749115403_seed_database.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent c82f8d6 commit 9cdd52c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

backend/pb_migrations/1749115403_seed_database.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,14 @@ migrate(
4242
}
4343
},
4444
(app) => {
45+
function constructFilterString(names) {
46+
return names.map((name) => `name = "${name}"`).join(" || ");
47+
}
4548
// Remove cats
4649
let pets = app.findCollectionByNameOrId("pets");
4750
let catRecords = app.findRecordsByFilter(
4851
pets,
49-
CAT_NAMES.map((name) => `name = "${name}"`).join("||")
52+
constructFilterString(CAT_NAMES)
5053
);
5154
for (let record of catRecords) {
5255
app.delete(record);

0 commit comments

Comments
 (0)