diff --git a/server/api/Login/ReqNonce.ts b/server/api/Login/ReqNonce.ts index 71417c2..3398070 100644 --- a/server/api/Login/ReqNonce.ts +++ b/server/api/Login/ReqNonce.ts @@ -1,4 +1,4 @@ -import { GET } from "../defs"; +import { ngGET } from "../defs"; import type { structure } from "../../apiStructure/sammoRootAPI"; import type { ExtractError, ExtractQuery, ExtractResponse } from "../../apiStructure/defs"; @@ -7,11 +7,17 @@ type RType = ExtractResponse; type EType = ExtractError; type QType = ExtractQuery; -export class ReqNonce extends GET{ +/*export class ReqNonce extends GET{ readonly argValidator = undefined; readonly procDecorator = [] as const; protected ReqNonce = Symbol("ReqNonce");//TODO: remove this protected override async api(query: QType): Promise { throw new Error("Method not implemented."); } -} \ No newline at end of file +}*/ + +export const ReqNonce = ngGET(undefined)([] as const)( + (query, ctx, req, res) => { + throw new Error("Method not implemented."); + } +); \ No newline at end of file diff --git a/server/api/defs.ts b/server/api/defs.ts index 45f4e19..13a8d8a 100644 --- a/server/api/defs.ts +++ b/server/api/defs.ts @@ -208,12 +208,16 @@ function ngGenerateAPI(args: { - argValidator?: ValidatorType, - procDecoratorChain: PD, - callback: (query: Q, ctx: ResolveChain, expressReq: Request, expressRes: Response) => Promise, -}): ngAPIExecuter{ - return ngGenerateAPI('get', args); +export function ngGET(argValidator?: ValidatorType){ + return (procDecoratorChain: PD) => { + return (callback: (query: Q, ctx: ResolveChain, expressReq: Request, expressRes: Response) => Promise) => { + return ngGenerateAPI('get', { + argValidator, + procDecoratorChain, + callback, + }); + } + } } interface ngGET extends ngAPIExecuter{