//native
type Smartsheet = {
token: string;
baseUrl: string;
};
/**
* Update Proof Status
* Sets the proof status as either complete or incomplete.
*/
export async function main(
auth: Smartsheet,
sheetId: string,
proofId: string,
body: { isCompleted?: false | true },
) {
const url = new URL(
`${auth.baseUrl}/sheets/${sheetId}/proofs/${proofId}`,
);
const response = await fetch(url, {
method: "PUT",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer " + auth.token,
},
body: JSON.stringify(body),
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 235 days ago