Skip to content

Instantly share code, notes, and snippets.

@dsibinski
Last active June 28, 2021 03:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsibinski/13b1ba20c4c7fb03171550cbd1b04f0c to your computer and use it in GitHub Desktop.
Save dsibinski/13b1ba20c4c7fb03171550cbd1b04f0c to your computer and use it in GitHub Desktop.
module.exports.StockService = function (rootUrl: string) {
this.rootUrl = rootUrl + "/Stock/";
};
module.exports.StockService.prototype.getStockInfo = function (articleId: Guid) {
let url = this.rootUrl + "Info";
return get(url, {
articleId: articleId
});
};
export class StockServiceTyped {
rootUrl: string;
constructor(rootUrl: string) {
this.rootUrl = rootUrl + "/Stock/";
}
async getStockInfo(articleId: Guid): StockInfoViewModel {
const url = this.rootUrl + "Info";
return getTyped<StockInfoViewModel>(url, { articleId: articleId });
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment