mirror of
https://github.com/hex248/sprint.git
synced 2026-02-08 02:33:01 +00:00
fix: proper cancellation handling
This commit is contained in:
@@ -647,3 +647,9 @@ export const GetSubscriptionResponseSchema = z.object({
|
||||
});
|
||||
|
||||
export type GetSubscriptionResponse = z.infer<typeof GetSubscriptionResponseSchema>;
|
||||
|
||||
export const CancelSubscriptionResponseSchema = z.object({
|
||||
subscription: SubscriptionRecordSchema,
|
||||
});
|
||||
|
||||
export type CancelSubscriptionResponse = z.infer<typeof CancelSubscriptionResponseSchema>;
|
||||
|
||||
@@ -3,6 +3,7 @@ import { z } from "zod";
|
||||
import {
|
||||
ApiErrorSchema,
|
||||
AuthResponseSchema,
|
||||
CancelSubscriptionResponseSchema,
|
||||
CreateCheckoutSessionRequestSchema,
|
||||
CreateCheckoutSessionResponseSchema,
|
||||
CreatePortalSessionResponseSchema,
|
||||
@@ -628,6 +629,17 @@ export const apiContract = c.router({
|
||||
},
|
||||
headers: csrfHeaderSchema,
|
||||
},
|
||||
subscriptionCancel: {
|
||||
method: "POST",
|
||||
path: "/subscription/cancel",
|
||||
body: emptyBodySchema,
|
||||
responses: {
|
||||
200: CancelSubscriptionResponseSchema,
|
||||
404: ApiErrorSchema,
|
||||
500: ApiErrorSchema,
|
||||
},
|
||||
headers: csrfHeaderSchema,
|
||||
},
|
||||
subscriptionGet: {
|
||||
method: "GET",
|
||||
path: "/subscription/get",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export type {
|
||||
ApiError,
|
||||
AuthResponse,
|
||||
CancelSubscriptionResponse,
|
||||
CreateCheckoutSessionRequest,
|
||||
CreateCheckoutSessionResponse,
|
||||
CreatePortalSessionResponse,
|
||||
@@ -67,6 +68,7 @@ export type {
|
||||
export {
|
||||
ApiErrorSchema,
|
||||
AuthResponseSchema,
|
||||
CancelSubscriptionResponseSchema,
|
||||
CreateCheckoutSessionRequestSchema,
|
||||
CreateCheckoutSessionResponseSchema,
|
||||
CreatePortalSessionResponseSchema,
|
||||
|
||||
Reference in New Issue
Block a user