mirror of
https://github.com/hex248/sprint.git
synced 2026-02-08 02:33:01 +00:00
subscription routes
This commit is contained in:
@@ -26,10 +26,7 @@ export async function createSubscription(data: {
|
||||
}
|
||||
|
||||
export async function getSubscriptionByUserId(userId: number) {
|
||||
const [subscription] = await db
|
||||
.select()
|
||||
.from(Subscription)
|
||||
.where(eq(Subscription.userId, userId));
|
||||
const [subscription] = await db.select().from(Subscription).where(eq(Subscription.userId, userId));
|
||||
return subscription;
|
||||
}
|
||||
|
||||
@@ -51,7 +48,7 @@ export async function updateSubscription(
|
||||
cancelAtPeriodEnd: boolean;
|
||||
trialEnd: Date;
|
||||
quantity: number;
|
||||
}>
|
||||
}>,
|
||||
) {
|
||||
const [subscription] = await db
|
||||
.update(Subscription)
|
||||
|
||||
Reference in New Issue
Block a user