mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2026-08-31 19:03:45 +02:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c6c0051f82 | ||
|
|
6935c0811c | ||
|
|
66001b547f | ||
|
|
c574fccda7 | ||
|
|
2cfa0babe1 |
+1
-1
@@ -1,4 +1,4 @@
|
||||
FROM node:16-alpine
|
||||
FROM node:24-alpine
|
||||
|
||||
# Create app directories
|
||||
RUN mkdir -p /usr/src/app
|
||||
|
||||
+2
-1
@@ -96,10 +96,11 @@ Use this to unlock all features for one user for a specified duration.
|
||||
|
||||
### request
|
||||
|
||||
request properties: ``purchaseToken`` and ``purchaseId``
|
||||
request properties: ``purchaseToken``, ``purchaseId`` and ``dryRun``
|
||||
|
||||
- ``purchasetoken`` is a string which the client shows at the purchase screen
|
||||
- ``purchaseId`` is the ID that is used at the bill
|
||||
- ``dryRun`` is a boolean; setting true will skip the actual unlocking
|
||||
|
||||
### response
|
||||
|
||||
|
||||
Generated
+385
-291
File diff suppressed because it is too large
Load Diff
+14
-10
@@ -140,13 +140,15 @@ export const createAdminRouter = ({ database, websocket, eventHandler }: {
|
||||
if (
|
||||
typeof req.body !== 'object' ||
|
||||
typeof req.body.purchaseToken !== 'string' ||
|
||||
typeof req.body.purchaseId !== 'string'
|
||||
typeof req.body.purchaseId !== 'string' ||
|
||||
typeof req.body.dryRun !== 'boolean'
|
||||
) {
|
||||
throw new BadRequest()
|
||||
}
|
||||
|
||||
const purchaseToken: string = req.body.purchaseToken
|
||||
const purchaseId: string = req.body.purchaseId
|
||||
const dryRun: boolean = req.body.dryRun
|
||||
|
||||
const tokenContent = await verifyIdentitifyToken(purchaseToken)
|
||||
|
||||
@@ -250,15 +252,17 @@ export const createAdminRouter = ({ database, websocket, eventHandler }: {
|
||||
}
|
||||
}
|
||||
|
||||
await addPurchase({
|
||||
database,
|
||||
familyId: tokenContent.familyId,
|
||||
type: 'year',
|
||||
service: 'directpurchase',
|
||||
transactionId: purchaseId,
|
||||
websocket,
|
||||
transaction
|
||||
})
|
||||
if (!dryRun) {
|
||||
await addPurchase({
|
||||
database,
|
||||
familyId: tokenContent.familyId,
|
||||
type: 'year',
|
||||
service: 'directpurchase',
|
||||
transactionId: purchaseId,
|
||||
websocket,
|
||||
transaction
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user