v1.6.0/interactive system message

This commit is contained in:
2020-08-03 19:42:00 -04:00
parent 9d0cb56cda
commit fa5045805b
7 changed files with 122 additions and 8 deletions
+18 -1
View File
@@ -107,6 +107,23 @@ export const fetcher = async ({ endpoint, method, ...args }) => {
);
};
export const webhookFetcher = async ({ endpoint, ...args }) => {
return new Promise((resolve, reject) =>
chrome.runtime.sendMessage(
{
type: 'API_CALL',
url: endpoint,
method: 'POST',
...args,
},
(response) => {
if (response.status > 299) reject(response);
else resolve({ json: () => response });
}
)
);
};
export const CreateRoomApi = async (data) => {
return fetcher({
endpoint: 'create',
@@ -180,4 +197,4 @@ export const UpdateAdminOnly = async (data) => {
endpoint: `updateAdminOnly/${data.partyName}/${data.adminOnly}`,
method: 'PUT',
});
}
};