mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-10-31 18:19:43 +00:00
fix(couples): protect joined invites from cancellation
This commit is contained in:
1 parent
a02e9d531b
commit
1fed348072
10 files changed
+139
-2
No files matched your search
@@ -12,12 +12,14 @@ describe("coupleApi", () => {
|
||||
await coupleApi.getState();
|
||||
await coupleApi.create();
|
||||
await coupleApi.join("ABCD2345");
|
||||
await coupleApi.cancelInvite();
|
||||
await coupleApi.cancel();
|
||||
|
||||
expect(request.mock.calls).toEqual([
|
||||
["/v1/couple"],
|
||||
["/v1/couple", { method: "POST", body: {} }],
|
||||
["/v1/couple", { method: "POST", body: { invite_code: "ABCD2345" } }],
|
||||
["/v1/couple/invite", { method: "DELETE" }],
|
||||
["/v1/couple", { method: "DELETE" }],
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -24,4 +24,5 @@ export const coupleApi = {
|
||||
body: { invite_code: inviteCode },
|
||||
}),
|
||||
cancel: () => apiRequest<CoupleMutationResponse>("/v1/couple", { method: "DELETE" }),
|
||||
cancelInvite: () => apiRequest<CoupleMutationResponse>("/v1/couple/invite", { method: "DELETE" }),
|
||||
};
|
||||
Reference in new issue
Block a user