fix(api): response handling in FormerRestHeadSpecAPI
This commit is contained in:
@@ -38,12 +38,8 @@ function FormerRestHeadSpecAPI(options: {
|
||||
throw new Error(`API request failed with status ${response.status}`);
|
||||
}
|
||||
|
||||
if (mode === 'read') {
|
||||
const data = await response.json();
|
||||
return data as any;
|
||||
} else {
|
||||
return value as any;
|
||||
}
|
||||
return data as unknown;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user