Tidy stale comments and duplicated helpers
Comments carried over from web_server (CVLayout.vue, messageResolver, the Spotify token code) and ones outdated by later changes (the email window now anchors on ReceivedAt, failed emails are retried) are corrected. truncateRunes had a copy in handlers and in services; there is now one, services.TruncateRunes. cleanEmailBody's regexes are compiled once, a status check that could never fire is gone, and api.js loses its unused put/patch helpers. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
+3
-6
@@ -35,12 +35,11 @@ export class ApiError extends Error {
|
||||
* @param {string} method
|
||||
* @param {string} path route below the API base, with its leading slash
|
||||
* @param {object} [options]
|
||||
* @param {*} [options.body] JSON-serialisable body, or a FormData for
|
||||
* multipart uploads (axios sets the boundary itself)
|
||||
* @param {*} [options.body] JSON-serialisable body
|
||||
* @param {string} [options.fallback] message to use when the backend sent no
|
||||
* `error` string — callers pass the sentence their UI shows
|
||||
* Any other option (`headers`, `params`, `onUploadProgress`, `signal`, …) is
|
||||
* handed to axios unchanged.
|
||||
* Any other option (`headers`, `params`, `signal`, …) is handed to axios
|
||||
* unchanged.
|
||||
*/
|
||||
async function request(method, path, { body, fallback, ...config } = {}) {
|
||||
try {
|
||||
@@ -67,6 +66,4 @@ export const api = {
|
||||
get: (path, options) => request("get", path, options),
|
||||
delete: (path, options) => request("delete", path, options),
|
||||
post: (path, body, options) => request("post", path, { ...options, body }),
|
||||
put: (path, body, options) => request("put", path, { ...options, body }),
|
||||
patch: (path, body, options) => request("patch", path, { ...options, body }),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user