v1.6.0/interactive system message
This commit is contained in:
+18
-1
@@ -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',
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user