UNPKG

retrofit-axios-ts

Version:

A declarative and axios based retrofit implementation for JavaScript and TypeScript.

22 lines (21 loc) 703 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Query = void 0; const ensureMeta_1 = require("../helpers/ensureMeta"); /** * Set query as variable in API method. * @param paramName * @sample @Query('group') group: string * @constructor */ const Query = (paramName) => { return (target, methodName, paramIndex) => { (0, ensureMeta_1.ensureMeta)(target, methodName); if (!target.__meta__[methodName].queryParams) { target.__meta__[methodName].queryParams = {}; } target.__meta__[methodName].queryParams[paramIndex] = paramName; }; }; exports.Query = Query; exports.default = exports.Query;