... out of all things, a frontend logic error
This commit is contained in:
@@ -147,7 +147,7 @@ export const postDataApiRouter = createTRPCRouter({
|
|||||||
const userSessions = {} as Record<string, APISession>;
|
const userSessions = {} as Record<string, APISession>;
|
||||||
for (const each of sessions) {
|
for (const each of sessions) {
|
||||||
const targetUser = users.find(
|
const targetUser = users.find(
|
||||||
(u) => each.key.includes(u.id) || each.value.userId === u.userId,
|
(u: any) => each.key.includes(u.id) || each.value.userId === u.userId,
|
||||||
);
|
);
|
||||||
if (!targetUser) continue;
|
if (!targetUser) continue;
|
||||||
userSessions[targetUser?.userId ?? ""] = each.value;
|
userSessions[targetUser?.userId ?? ""] = each.value;
|
||||||
|
|||||||
@@ -144,7 +144,6 @@ export const zBookingEntry = z.object({
|
|||||||
createdAt: z.string().nullable().optional(),
|
createdAt: z.string().nullable().optional(),
|
||||||
updatedAt: z.string().nullable().optional(),
|
updatedAt: z.string().nullable().optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export type BookingEntry = z.infer<typeof zBookingEntry>;
|
export type BookingEntry = z.infer<typeof zBookingEntry>;
|
||||||
|
|
||||||
export const zPostDataEntry = z.object({
|
export const zPostDataEntry = z.object({
|
||||||
@@ -157,7 +156,6 @@ export const zPostDataEntry = z.object({
|
|||||||
createdAt: z.string().nullable().optional(),
|
createdAt: z.string().nullable().optional(),
|
||||||
updatedAt: z.string().nullable().optional(),
|
updatedAt: z.string().nullable().optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export type PostDataEntry = z.infer<typeof zPostDataEntry>;
|
export type PostDataEntry = z.infer<typeof zPostDataEntry>;
|
||||||
|
|
||||||
const zPostDataHistory = z.object({
|
const zPostDataHistory = z.object({
|
||||||
@@ -168,7 +166,6 @@ const zPostDataHistory = z.object({
|
|||||||
createdAt: z.string().nullable().optional(),
|
createdAt: z.string().nullable().optional(),
|
||||||
updatedAt: z.string().nullable().optional(),
|
updatedAt: z.string().nullable().optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export type PostDataHistory = z.infer<typeof zPostDataHistory>;
|
export type PostDataHistory = z.infer<typeof zPostDataHistory>;
|
||||||
|
|
||||||
export const zPresetDataEntry = z.object({
|
export const zPresetDataEntry = z.object({
|
||||||
@@ -181,7 +178,6 @@ export const zPresetDataEntry = z.object({
|
|||||||
createdAt: z.string().nullable().optional(),
|
createdAt: z.string().nullable().optional(),
|
||||||
dealerId: z.number().optional().nullable(),
|
dealerId: z.number().optional().nullable(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export type PresetDataEntry = z.infer<typeof zPresetDataEntry>;
|
export type PresetDataEntry = z.infer<typeof zPresetDataEntry>;
|
||||||
|
|
||||||
export const fsPair = z.object({
|
export const fsPair = z.object({
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { trpc } from "$lib/trpc/trpc";
|
import { trpc } from "$lib/trpc/trpc";
|
||||||
import toast from "svelte-french-toast";
|
import toast from "svelte-french-toast";
|
||||||
import type { ApiPostUser, PostDataEntry } from "$lib/utils/data.types";
|
import type { ApiPostUser, PostDataEntry } from "$lib/utils/data.types";
|
||||||
import { setPostDataTableData, postDataTableOptions } from "./stores";
|
import { setPostDataTableData } from "./stores";
|
||||||
import Title from "$lib/components/atoms/title.svelte";
|
import Title from "$lib/components/atoms/title.svelte";
|
||||||
import Select from "$lib/components/atoms/select.svelte";
|
import Select from "$lib/components/atoms/select.svelte";
|
||||||
import PostDataView from "./post-data-view.svelte";
|
import PostDataView from "./post-data-view.svelte";
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
function setChosenUser(e: any) {
|
function setChosenUser(e: any) {
|
||||||
affectingRowVisibility = true;
|
affectingRowVisibility = true;
|
||||||
const chosen = e.target.value;
|
const chosen = e.target.value;
|
||||||
chosenUser = postdata.users.find((u) => u.userName === chosen);
|
chosenUser = postdata.users.find((u) => u.userId === chosen);
|
||||||
setChosenData();
|
setChosenData();
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
affectingRowVisibility = false;
|
affectingRowVisibility = false;
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
postdata.users = d.users;
|
postdata.users = d.users;
|
||||||
usersSelect = d.users.map((u) => ({
|
usersSelect = d.users.map((u) => ({
|
||||||
label: `${u.userName} - ${u.userId}`,
|
label: `${u.userName} - ${u.userId}`,
|
||||||
value: u.userName,
|
value: u.userId,
|
||||||
}));
|
}));
|
||||||
chosenUser = d.users[0];
|
chosenUser = d.users[0];
|
||||||
} else if (!d.ok) {
|
} else if (!d.ok) {
|
||||||
|
|||||||
Reference in New Issue
Block a user