feat: get friends requests from api

This commit is contained in:
Zamitto
2024-07-10 18:52:08 -03:00
parent 6ff48605da
commit b3f87d5662
8 changed files with 54 additions and 32 deletions

View File

@@ -0,0 +1,16 @@
import { registerEvent } from "../register-event";
import { HydraApi } from "@main/services";
import { PendingFriendRequest } from "@types";
const getFriendRequests = async (
_event: Electron.IpcMainInvokeEvent
): Promise<PendingFriendRequest[] | null> => {
try {
const response = await HydraApi.get(`/profile/friend-requests`);
return response.data;
} catch (err) {
return null;
}
};
registerEvent("getFriendRequests", getFriendRequests);