feat: setup the attachment to the passenger clients

This commit is contained in:
Nathnael
2026-07-18 09:44:33 +00:00
parent bdcd5e957e
commit f9286e781b
20 changed files with 1832 additions and 181 deletions

View File

@@ -31,7 +31,7 @@ class ApiClient {
}
}
return Promise.reject(error);
}
},
);
}
@@ -40,6 +40,15 @@ class ApiClient {
return response.data.data;
}
/**
* GET without the `{ success, data }` unwrap. Binary endpoints (file streams)
* have no envelope to unwrap, so `get` would hand back `undefined`.
*/
async getRaw<T>(url: string, config?: AxiosRequestConfig): Promise<T> {
const response = await this.client.get<T>(url, config);
return response.data;
}
async post<T>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T> {
const response = await this.client.post<{ success: boolean; data: T }>(url, data, config);
return response.data.data;