first commit

This commit is contained in:
Hydra
2024-04-14 04:20:27 +01:00
commit 992ec5ab49
145 changed files with 37479 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
import { userPreferencesRepository } from "@main/repository";
import { registerEvent } from "../register-event";
const getUserPreferences = async (_event: Electron.IpcMainInvokeEvent) =>
userPreferencesRepository.findOne({
where: { id: 1 },
});
registerEvent(getUserPreferences, {
name: "getUserPreferences",
});

View File

@@ -0,0 +1,21 @@
import { userPreferencesRepository } from "@main/repository";
import { registerEvent } from "../register-event";
import type { UserPreferences } from "@types";
const updateUserPreferences = async (
_event: Electron.IpcMainInvokeEvent,
preferences: Partial<UserPreferences>
) => {
await userPreferencesRepository.upsert(
{
id: 1,
...preferences,
},
["id"]
);
};
registerEvent(updateUserPreferences, {
name: "updateUserPreferences",
});