mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: block and unblock events
This commit is contained in:
parent
304aa011ad
commit
edf920fed3
9 changed files with 55 additions and 3 deletions
|
|
@ -43,6 +43,8 @@ import "./auth/sign-out";
|
|||
import "./auth/open-auth-window";
|
||||
import "./auth/get-session-hash";
|
||||
import "./user/get-user";
|
||||
import "./user/block-user";
|
||||
import "./user/unblock-user";
|
||||
import "./user/get-user-friends";
|
||||
import "./profile/get-friend-requests";
|
||||
import "./profile/get-me";
|
||||
|
|
|
|||
11
src/main/events/user/block-user.ts
Normal file
11
src/main/events/user/block-user.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { registerEvent } from "../register-event";
|
||||
import { HydraApi } from "@main/services";
|
||||
|
||||
const blockUser = async (
|
||||
_event: Electron.IpcMainInvokeEvent,
|
||||
userId: string
|
||||
): Promise<void> => {
|
||||
return HydraApi.get(`/user/${userId}/block`);
|
||||
};
|
||||
|
||||
registerEvent("block", blockUser);
|
||||
11
src/main/events/user/unblock-user.ts
Normal file
11
src/main/events/user/unblock-user.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { registerEvent } from "../register-event";
|
||||
import { HydraApi } from "@main/services";
|
||||
|
||||
const unblockUser = async (
|
||||
_event: Electron.IpcMainInvokeEvent,
|
||||
userId: string
|
||||
): Promise<void> => {
|
||||
return HydraApi.get(`/user/${userId}/unblock`);
|
||||
};
|
||||
|
||||
registerEvent("unblockUser", unblockUser);
|
||||
Loading…
Add table
Add a link
Reference in a new issue