Add Docker support with Dockerfile and .dockerignore, update package dependencies, and switch to adapter-node for Svelte
This commit is contained in:
@@ -12,6 +12,12 @@ export const getYears = query(async () => {
|
||||
return await DB.GET.years({});
|
||||
});
|
||||
|
||||
export const getPeople = query(v.number(), async (year) => {
|
||||
return await DB.GET.people({
|
||||
yearId: year
|
||||
});
|
||||
});
|
||||
|
||||
export const addYear = command(v.number(), async (year) => {
|
||||
await DB.CREATE.year({
|
||||
year: year
|
||||
@@ -20,36 +26,22 @@ export const addYear = command(v.number(), async (year) => {
|
||||
getYears().refresh();
|
||||
});
|
||||
|
||||
export const deleteYear = command(v.number(), async (year) => {
|
||||
await DB.DELETE.year({
|
||||
year
|
||||
});
|
||||
|
||||
getYears().refresh();
|
||||
});
|
||||
|
||||
export const addPerson = command(v.any(), async (data) => {
|
||||
await DB.CREATE.person(data);
|
||||
|
||||
getPeople(data.yearId).refresh();
|
||||
});
|
||||
|
||||
export const getPeople = query(v.number(), async (year) => {
|
||||
return await DB.GET.people({
|
||||
yearId: year
|
||||
await DB.CREATE.person({
|
||||
name: data.name,
|
||||
year: {
|
||||
connect: {
|
||||
year: data.year
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
export const deletePerson = command(v.number(), async (id) => {
|
||||
const person = await DB.DELETE.person({ id });
|
||||
const year = await DB.GET.year({ year: person!.yearId });
|
||||
|
||||
getPeople(year!.year).refresh();
|
||||
getPeople(data.year).refresh();
|
||||
});
|
||||
|
||||
export const addGift = command(v.any(), async (data) => {
|
||||
await DB.CREATE.gift({
|
||||
...data,
|
||||
...data.gift,
|
||||
person: {
|
||||
connect: {
|
||||
id: data.personId
|
||||
@@ -69,6 +61,21 @@ export const updateGift = command(v.any(), async (data) => {
|
||||
getPeople(person!.yearId).refresh();
|
||||
});
|
||||
|
||||
export const deleteYear = command(v.number(), async (year) => {
|
||||
await DB.DELETE.year({
|
||||
year
|
||||
});
|
||||
|
||||
getYears().refresh();
|
||||
});
|
||||
|
||||
export const deletePerson = command(v.number(), async (id) => {
|
||||
const person = await DB.DELETE.person({ id });
|
||||
const year = await DB.GET.year({ year: person!.yearId });
|
||||
|
||||
getPeople(year!.year).refresh();
|
||||
});
|
||||
|
||||
export const deleteGift = command(v.number(), async (id) => {
|
||||
const gift = await DB.DELETE.gift({ id });
|
||||
const person = await DB.GET.person({ id: gift.personId });
|
||||
|
||||
@@ -11,9 +11,7 @@
|
||||
<link rel="icon" href={favicon} />
|
||||
</svelte:head>
|
||||
|
||||
<main
|
||||
class="min-h-screen bg-slate-50 relative font-sans selection:bg-red-100 bg-linear-to-b from-red-950 via-red-900 to-green-900"
|
||||
>
|
||||
<main>
|
||||
<div class="container">
|
||||
<Header />
|
||||
<YearSelection />
|
||||
|
||||
Reference in New Issue
Block a user