mirror of
https://github.com/imputnet/cobalt.git
synced 2026-10-24 19:11:16 +00:00
api/processing/request: backwards compat with boolean localProcessing
This commit is contained in:
parent
28ab2747ce
commit
ac85ce86c0
1 changed files with 5 additions and 0 deletions
|
|
@ -114,6 +114,11 @@ export function createResponse(responseType, responseData) {
|
|||
}
|
||||
|
||||
export function normalizeRequest(request) {
|
||||
// TODO: remove after backwards compatibility period
|
||||
if ("localProcessing" in request && typeof request.localProcessing === "boolean") {
|
||||
request.localProcessing = request.localProcessing ? "preferred" : "disabled";
|
||||
}
|
||||
|
||||
return apiSchema.safeParseAsync(request).catch(() => (
|
||||
{ success: false }
|
||||
));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue