mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 15:58:38 +01:00
13 lines
352 B
TypeScript
13 lines
352 B
TypeScript
|
|
|
|
import { AppsumoCodeModel } from '@schema/AppsumoCode'
|
|
|
|
export async function checkAppsumoCode(code: string) {
|
|
const target = await AppsumoCodeModel.exists({ code, used_at: { $exists: false } });
|
|
return target;
|
|
}
|
|
|
|
|
|
export async function useAppsumoCode(code: string) {
|
|
await AppsumoCodeModel.updateOne({ code }, { used_at: Date.now() });
|
|
} |