Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: date format transformation causing sync error #2366

Merged
merged 1 commit into from
Mar 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/lib/survey/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export const getSurvey = async (surveyId: string): Promise<TSurvey | null> => {

// since the unstable_cache function does not support deserialization of dates, we need to manually deserialize them
// https://github.com/vercel/next.js/issues/51613
return survey ? formatDateFields(survey, ZSurvey) : null;
return survey ? formatSurveyDateFields(survey) : null;
};

export const getSurveysByActionClassId = async (actionClassId: string, page?: number): Promise<TSurvey[]> => {
Expand Down Expand Up @@ -276,7 +276,7 @@ export const getSurveysByActionClassId = async (actionClassId: string, page?: nu
revalidate: SERVICES_REVALIDATION_INTERVAL,
}
)();
return surveys.map((survey) => formatDateFields(survey, ZSurvey));
return surveys.map((survey) => formatSurveyDateFields(survey));
};

export const getSurveys = async (
Expand Down Expand Up @@ -900,7 +900,7 @@ export const getSyncSurveys = async (
}
)();

return surveys.map((survey) => formatDateFields(survey as TSurvey, ZSurvey));
return surveys.map((survey) => formatSurveyDateFields(survey));
};

export const getSurveyIdByResultShareKey = async (resultShareKey: string): Promise<string | null> => {
Expand Down
Loading