import { Service } from "typedi"; import BaseNotary from "../BaseCustomer"; import User from "le-coffre-resources/dist/Notary"; @Service() export default class Users extends BaseNotary { private static instance: Users; private readonly baseURl = this.namespaceUrl.concat("/Users"); private constructor() { super(); } public static getInstance() { if (!this.instance) { return new Users(); } else { return this.instance; } } public async get(): Promise { const url = new URL(this.baseURl); try { return await this.getRequest(url); } catch (err) { this.onError(err); return Promise.reject(err); } } public async getOne(uid: string): Promise { const url = new URL(this.baseURl.concat("/").concat(uid)); try { return await this.getRequest(url); } catch (err) { this.onError(err); return Promise.reject(err); } } // public async post(params: User): Promise { // const url = new URL(this.baseURl); // try { // return await this.postRequest(url, params); // } catch (err) { // this.onError(err); // return Promise.reject(err); // } // } }