mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2026-08-31 19:03:45 +02:00
add unpaid14 to the premium unlock api
This commit is contained in:
+8
-2
@@ -141,7 +141,8 @@ export const createAdminRouter = ({ database, websocket, eventHandler }: {
|
||||
typeof req.body !== 'object' ||
|
||||
typeof req.body.purchaseToken !== 'string' ||
|
||||
typeof req.body.purchaseId !== 'string' ||
|
||||
typeof req.body.dryRun !== 'boolean'
|
||||
typeof req.body.dryRun !== 'boolean' ||
|
||||
typeof req.body.type !== 'string'
|
||||
) {
|
||||
throw new BadRequest()
|
||||
}
|
||||
@@ -149,6 +150,11 @@ export const createAdminRouter = ({ database, websocket, eventHandler }: {
|
||||
const purchaseToken: string = req.body.purchaseToken
|
||||
const purchaseId: string = req.body.purchaseId
|
||||
const dryRun: boolean = req.body.dryRun
|
||||
const type: string = req.body.type
|
||||
|
||||
if (type !== 'month' && type !== 'year' && type !== 'unpaid14') {
|
||||
throw new BadRequest()
|
||||
}
|
||||
|
||||
const tokenContent = await verifyIdentitifyToken(purchaseToken)
|
||||
|
||||
@@ -259,7 +265,7 @@ export const createAdminRouter = ({ database, websocket, eventHandler }: {
|
||||
await addPurchase({
|
||||
database,
|
||||
familyId: tokenContent.familyId,
|
||||
type: 'year',
|
||||
type,
|
||||
service: 'directpurchase',
|
||||
transactionId: purchaseId,
|
||||
websocket,
|
||||
|
||||
Reference in New Issue
Block a user