index.ts 633 B

1234567891011121314151617181920212223242526
  1. import invokeApi from '../helpers/apiHelpers';
  2. import apiPath from '../constants/apiPath';
  3. import config from '../config';
  4. export const initialPdfFile = async (token: string): Promise<any> =>
  5. invokeApi({
  6. path: apiPath.initPdf,
  7. method: 'GET',
  8. data: {
  9. f: token,
  10. },
  11. });
  12. export const saveFile = async (token: string, data: any): Promise<any> =>
  13. invokeApi({
  14. path: `${apiPath.saveFile}?f=${token}`,
  15. method: 'POST',
  16. data,
  17. });
  18. export const fetchXfdf = (token: string): Promise<any> =>
  19. fetch(`${config.API_HOST}${apiPath.getXfdf}?f=${token}`).then(res =>
  20. res.text()
  21. );
  22. export default {};