datasquirel/dist/package-shared/api/crud/put.js
Benjamin Toby 3730e4722e Updates
2025-07-05 15:16:31 +01:00

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,
});
}