Skip to content

Commit 603b6cf

Browse files
committed
fix(webapp): limit mutations answer concurrent changes with a 409
1 parent 41f65fd commit 603b6cf

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎apps/webapp/app/routes/api.v1.concurrency-limits.$name.override.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ const route = createActionApiRoute(
2727
switch (error.type) {
2828
case "limit_not_found":
2929
return json({ error: "Concurrency limit not found" }, { status: 404 });
30+
case "conflict":
31+
return json(
32+
{ error: "The limit changed concurrently; retry the request" },
33+
{ status: 409 }
34+
);
3035
case "invalid_override":
3136
return json({ error: error.message }, { status: 400 });
3237
default:

‎apps/webapp/app/routes/api.v1.concurrency-limits.$name.reset.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ const route = createActionApiRoute(
2323
switch (error.type) {
2424
case "limit_not_found":
2525
return json({ error: "Concurrency limit not found" }, { status: 404 });
26+
case "conflict":
27+
return json(
28+
{ error: "The limit changed concurrently; retry the request" },
29+
{ status: 409 }
30+
);
2631
case "limit_not_overridden":
2732
return json({ error: "Concurrency limit has no override to reset" }, { status: 400 });
2833
default:

0 commit comments

Comments
 (0)