Skip to content

Commit e720fd6

Browse files
authored
lint & ignore ts error on old migration scripts (#1948)
1 parent 6c37b85 commit e720fd6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lib/migrations/routines/02-update-assistants-models.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const updateAssistantsModels: Migration = {
77
name: "Update deprecated models in assistants with the default model",
88
up: async () => {
99
const models = (await import("$lib/server/models")).models;
10+
//@ts-expect-error the property doesn't exist anymore, keeping the script for reference
1011
const oldModels = (await import("$lib/server/models")).oldModels;
1112
const { assistants } = collections;
1213

@@ -20,7 +21,7 @@ const updateAssistantsModels: Migration = {
2021
// has an old model
2122
let newModelId = defaultModelId;
2223

23-
const oldModel = oldModels.find((m) => m.id === assistant.modelId);
24+
const oldModel = oldModels.find((m: (typeof models)[number]) => m.id === assistant.modelId);
2425
if (oldModel && oldModel.transferTo && !!models.find((m) => m.id === oldModel.transferTo)) {
2526
newModelId = oldModel.transferTo;
2627
}

0 commit comments

Comments
 (0)