mirror of
https://github.com/formbricks/formbricks.git
synced 2026-04-24 06:28:49 -05:00
fix: survey auto complete (#4442)
This commit is contained in:
committed by
GitHub
parent
8d2edf91a1
commit
c349a3b869
@@ -186,9 +186,11 @@ export const POST = async (request: Request) => {
|
||||
);
|
||||
|
||||
// Update survey status if necessary
|
||||
if (survey.autoComplete && responseCount === survey.autoComplete) {
|
||||
survey.status = "completed";
|
||||
await updateSurvey(survey);
|
||||
if (survey.autoComplete && responseCount >= survey.autoComplete) {
|
||||
await updateSurvey({
|
||||
...survey,
|
||||
status: "completed",
|
||||
});
|
||||
}
|
||||
|
||||
// Await webhook and email promises with allSettled to prevent early rejection
|
||||
|
||||
Reference in New Issue
Block a user