23 lines
492 B
JavaScript
23 lines
492 B
JavaScript
|
import { KemonoError } from "@wp/utils";
|
||
|
import { kemonoFetch } from "./kemono-fetch";
|
||
|
|
||
|
/**
|
||
|
* @type {KemonoAPI.DMs}
|
||
|
*/
|
||
|
export const dms = {
|
||
|
retrieveHasPendingDMs,
|
||
|
};
|
||
|
|
||
|
async function retrieveHasPendingDMs() {
|
||
|
try {
|
||
|
const response = await kemonoFetch(`/api/v1/has_pending_dms`);
|
||
|
|
||
|
if (!response || !response.ok) {
|
||
|
throw new Error(`Error ${response.status}: ${response.statusText}`);
|
||
|
}
|
||
|
return await response.json();
|
||
|
} catch (error) {
|
||
|
console.error(error);
|
||
|
}
|
||
|
}
|