mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-21 18:13:55 +00:00
13 lines
367 B
TypeScript
13 lines
367 B
TypeScript
import { registerEvent } from "../register-event";
|
|
import { HydraApi } from "@main/services";
|
|
import type { UserProfile } from "@types";
|
|
|
|
const getUser = async (
|
|
_event: Electron.IpcMainInvokeEvent,
|
|
userId: string
|
|
): Promise<UserProfile | null> => {
|
|
return HydraApi.get<UserProfile>(`/users/${userId}`).catch(() => null);
|
|
};
|
|
|
|
registerEvent("getUser", getUser);
|