Lib: Remove manual data invalidation in favor of pocketbase subscriptions
All checks were successful
Build Formula11 Docker Image / pocketbase-docker (push) Successful in 31s
All checks were successful
Build Formula11 Docker Image / pocketbase-docker (push) Successful in 31s
This commit is contained in:
@ -15,7 +15,6 @@
|
||||
import { get_driver_headshot_template } from "$lib/database";
|
||||
import { get_error_toast } from "$lib/toast";
|
||||
import { pb } from "$lib/pocketbase";
|
||||
import { invalidateAll } from "$app/navigation";
|
||||
import { error } from "@sveltejs/kit";
|
||||
import type { PageData } from "../../../routes/data/season/drivers/$types";
|
||||
|
||||
@ -124,7 +123,6 @@
|
||||
}
|
||||
await pb.collection("drivers").update(driver.id, driver_data);
|
||||
}
|
||||
invalidateAll();
|
||||
modalStore.close();
|
||||
} catch (error) {
|
||||
toastStore.trigger(get_error_toast("" + error));
|
||||
@ -142,7 +140,6 @@
|
||||
|
||||
try {
|
||||
await pb.collection("drivers").delete(driver.id);
|
||||
invalidateAll();
|
||||
modalStore.close();
|
||||
} catch (error) {
|
||||
toastStore.trigger(get_error_toast("" + error));
|
||||
|
@ -14,7 +14,6 @@
|
||||
import { format_date } from "$lib/date";
|
||||
import { get_error_toast } from "$lib/toast";
|
||||
import { pb } from "$lib/pocketbase";
|
||||
import { invalidateAll } from "$app/navigation";
|
||||
import { error } from "@sveltejs/kit";
|
||||
import type { PageData } from "../../../routes/data/season/races/$types";
|
||||
|
||||
@ -151,7 +150,6 @@
|
||||
}
|
||||
await pb.collection("races").update(race.id, race_data);
|
||||
}
|
||||
invalidateAll();
|
||||
modalStore.close();
|
||||
} catch (error) {
|
||||
toastStore.trigger(get_error_toast("" + error));
|
||||
@ -168,7 +166,6 @@
|
||||
|
||||
try {
|
||||
await pb.collection("races").delete(race.id);
|
||||
invalidateAll();
|
||||
modalStore.close();
|
||||
} catch (error) {
|
||||
toastStore.trigger(get_error_toast("" + error));
|
||||
|
@ -11,7 +11,6 @@
|
||||
import { DRIVER_HEADSHOT_HEIGHT, DRIVER_HEADSHOT_WIDTH } from "$lib/config";
|
||||
import { driver_dropdown_options } from "$lib/dropdown";
|
||||
import { get_error_toast } from "$lib/toast";
|
||||
import { invalidateAll } from "$app/navigation";
|
||||
import { pb } from "$lib/pocketbase";
|
||||
import type { PageData } from "../../../routes/racepicks/$types";
|
||||
|
||||
@ -131,7 +130,6 @@
|
||||
}
|
||||
await pb.collection("racepicks").update(racepick.id, racepick_data);
|
||||
}
|
||||
invalidateAll();
|
||||
modalStore.close();
|
||||
} catch (error) {
|
||||
toastStore.trigger(get_error_toast("" + error));
|
||||
@ -149,7 +147,6 @@
|
||||
|
||||
try {
|
||||
await pb.collection("racepicks").delete(racepick.id);
|
||||
invalidateAll();
|
||||
modalStore.close();
|
||||
} catch (error) {
|
||||
toastStore.trigger(get_error_toast("" + error));
|
||||
|
@ -14,7 +14,6 @@
|
||||
import { race_dropdown_options } from "$lib/dropdown";
|
||||
import { pb } from "$lib/pocketbase";
|
||||
import { get_error_toast } from "$lib/toast";
|
||||
import { invalidateAll } from "$app/navigation";
|
||||
import type { PageData } from "../../../routes/data/raceresults/$types";
|
||||
|
||||
interface RaceResultCardProps {
|
||||
@ -203,7 +202,6 @@
|
||||
|
||||
await pb.collection("raceresults").update(result.id, raceresult_data);
|
||||
}
|
||||
invalidateAll();
|
||||
modalStore.close();
|
||||
} catch (error) {
|
||||
toastStore.trigger(get_error_toast("" + error));
|
||||
@ -221,7 +219,6 @@
|
||||
|
||||
try {
|
||||
await pb.collection("raceresults").delete(result.id);
|
||||
invalidateAll();
|
||||
modalStore.close();
|
||||
} catch (error) {
|
||||
toastStore.trigger(get_error_toast("" + error));
|
||||
|
@ -12,7 +12,6 @@
|
||||
import { driver_dropdown_options, race_dropdown_options } from "$lib/dropdown";
|
||||
import { get_error_toast } from "$lib/toast";
|
||||
import { pb } from "$lib/pocketbase";
|
||||
import { invalidateAll } from "$app/navigation";
|
||||
import type { PageData } from "../../../routes/data/season/substitutions/$types";
|
||||
|
||||
interface SubstitutionCardProps {
|
||||
@ -91,7 +90,6 @@
|
||||
}
|
||||
await pb.collection("substitutions").update(substitution.id, substitution_data);
|
||||
}
|
||||
invalidateAll();
|
||||
modalStore.close();
|
||||
} catch (error) {
|
||||
toastStore.trigger(get_error_toast("" + error));
|
||||
@ -108,7 +106,6 @@
|
||||
|
||||
try {
|
||||
await pb.collection("substitutions").delete(substitution.id);
|
||||
invalidateAll();
|
||||
modalStore.close();
|
||||
} catch (error) {
|
||||
toastStore.trigger(get_error_toast("" + error));
|
||||
|
@ -18,7 +18,6 @@
|
||||
import { get_team_banner_template, get_team_logo_template } from "$lib/database";
|
||||
import { get_error_toast } from "$lib/toast";
|
||||
import { pb } from "$lib/pocketbase";
|
||||
import { invalidateAll } from "$app/navigation";
|
||||
import { error } from "@sveltejs/kit";
|
||||
import type { PageData } from "../../../routes/data/season/teams/$types";
|
||||
|
||||
@ -153,7 +152,6 @@
|
||||
}
|
||||
await pb.collection("teams").update(team.id, team_data);
|
||||
}
|
||||
invalidateAll();
|
||||
modalStore.close();
|
||||
} catch (error) {
|
||||
toastStore.trigger(get_error_toast("" + error));
|
||||
@ -171,7 +169,6 @@
|
||||
|
||||
try {
|
||||
await pb.collection("teams").delete(team.id);
|
||||
invalidateAll();
|
||||
modalStore.close();
|
||||
} catch (error) {
|
||||
toastStore.trigger(get_error_toast("" + error));
|
||||
|
@ -227,8 +227,6 @@
|
||||
});
|
||||
drawerStore.close();
|
||||
}
|
||||
|
||||
invalidate("data:users");
|
||||
} catch (error) {
|
||||
toastStore.trigger(get_error_toast("" + error));
|
||||
}
|
||||
|
Reference in New Issue
Block a user