import { DocumentNotary } from "le-coffre-resources/dist/Notary"; import BaseNotary from "../BaseNotary"; // TODO Type get query params -> Where + inclue + orderby export interface IGetDocumentNotaryparams { where?: {}; include?: {}; orderBy?: {}; } // TODO Type getbyuid query params export default class DocumentsNotary extends BaseNotary { private static instance: DocumentsNotary; private readonly baseURl = this.namespaceUrl.concat("/documents_notary"); private constructor() { super(); } public static getInstance() { if (!this.instance) { return new this(); } else { return this.instance; } } // public async get(q: IGetDocumentNotaryparams): Promise { // const url = new URL(this.baseURl); // const query = { q }; // Object.entries(query).forEach(([key, value]) => url.searchParams.set(key, JSON.stringify(value))); // try { // return await this.getRequest(url); // } catch (err) { // this.onError(err); // return Promise.reject(err); // } // } /** * @description : Create a Document Notary */ public async post(body: any): Promise { const url = new URL(this.baseURl); try { return await this.postRequestFormData(url, body); } catch (err) { this.onError(err); return Promise.reject(err); } } }