databag/net/web/src/api/setCardCloseMessage.js

14 lines
374 B
JavaScript
Raw Normal View History

2022-04-05 23:52:39 +00:00
import { checkResponse, fetchWithTimeout } from './fetchUtil';
export async function setCardCloseMessage(server, message) {
2022-07-29 21:23:02 +00:00
let host = "";
if (server) {
host = `https://${server}`;
}
let status = await fetchWithTimeout(`${host}/contact/closeMessage`, { method: 'PUT', body: JSON.stringify(message) });
2022-04-05 23:52:39 +00:00
checkResponse(status);
return await status.json();
}