fix: data migration type error

This commit is contained in:
Matthias Nannt
2024-08-07 23:40:11 +02:00
parent 32b3a7d1d0
commit d65a49a7e7

View File

@@ -49,6 +49,7 @@ async function runMigration(): Promise<void> {
const updatedSurvey: UpdatedSurvey = structuredClone(survey) as UpdatedSurvey;
if (survey.redirectUrl) {
// @ts-expect-error -- TS is not able to infer the type of updatedSurvey
updatedSurvey.endings = [
{
type: "redirectToUrl",
@@ -58,6 +59,7 @@ async function runMigration(): Promise<void> {
},
];
} else if (survey.thankYouCard?.enabled) {
// @ts-expect-error -- TS is not able to infer the type of updatedSurvey
updatedSurvey.endings = [
{
...survey.thankYouCard,
@@ -66,6 +68,7 @@ async function runMigration(): Promise<void> {
},
];
} else {
// @ts-expect-error -- TS is not able to infer the type of updatedSurvey
updatedSurvey.endings = [];
}