15 lines
378 B
JavaScript
15 lines
378 B
JavaScript
import apiCrudPOST from "./post";
|
|
export default async function apiCrudPUT({ dbName, tableName, body, targetID, apiKey }) {
|
|
const updatedBody = Object.assign({}, body);
|
|
if (targetID) {
|
|
updatedBody["id"] = targetID;
|
|
}
|
|
return await apiCrudPOST({
|
|
dbName,
|
|
tableName,
|
|
body: updatedBody,
|
|
update: true,
|
|
apiKey,
|
|
});
|
|
}
|