mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-27 15:17:30 +00:00
fix(mail-ingest): send an uploaded .eml as multipart; publish the booking origin as a contract
- The upload posted its FormData through the client's JSON default, so the form went as JSON and the server saw no file (400). It goes through postMultipart now, like every other upload. - reservation-origin.ts becomes reservation-origin.contract.ts: the booking import sets an origin, and a contract is what another domain may import. - CI: the client's strict type check holds the whole program with strict checks and outgrew the default ~4 GB heap; it gets 8 GB like the server's.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import apiClient from './client';
|
||||
import apiClient, { postMultipart } from './client';
|
||||
|
||||
/**
|
||||
* The booking mail import (server nest/mail-ingest): the person's settings and
|
||||
@@ -43,6 +43,7 @@ export const mailIngestApi = {
|
||||
upload: (file: File): Promise<unknown> => {
|
||||
const form = new FormData();
|
||||
form.append('file', file);
|
||||
return apiClient.post('/mail-ingest/upload', form).then(data);
|
||||
// As multipart: under the client's default JSON content type the form went as JSON, without the file.
|
||||
return postMultipart('/mail-ingest/upload', form);
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user