perf upgrade
This commit is contained in:
@@ -14,7 +14,6 @@ import { TeamInput } from "../../types";
|
||||
import { teamKeys } from "../../queries";
|
||||
import SongPicker from "./song-picker";
|
||||
import PlayersPicker from "./players-picker";
|
||||
import imageCompression from "browser-image-compression";
|
||||
|
||||
interface TeamFormProps {
|
||||
close: () => void;
|
||||
@@ -120,6 +119,7 @@ const TeamForm = ({
|
||||
};
|
||||
|
||||
try {
|
||||
const { default: imageCompression } = await import("browser-image-compression");
|
||||
processedLogo = await imageCompression(logo, compressionOptions);
|
||||
logger.info("image compressed", {
|
||||
originalSize: logo.size,
|
||||
|
||||
@@ -7,7 +7,6 @@ import { SpotifyTrack } from "@/lib/spotify/types";
|
||||
import SongSearch from "./song-search";
|
||||
import DurationPicker from "./duration-picker";
|
||||
import SongSummary from "./song-summary";
|
||||
import { MusicNote } from "@phosphor-icons/react/dist/ssr";
|
||||
import { MusicNoteIcon } from "@phosphor-icons/react";
|
||||
|
||||
interface Song {
|
||||
|
||||
@@ -16,21 +16,21 @@ export const listTeamInfos = createServerFn()
|
||||
);
|
||||
|
||||
export const getTeam = createServerFn()
|
||||
.inputValidator(z.string())
|
||||
.validator(z.string())
|
||||
.middleware([superTokensFunctionMiddleware])
|
||||
.handler(async ({ data: teamId }) =>
|
||||
toServerResult(() => pbAdmin.getTeam(teamId))
|
||||
);
|
||||
|
||||
export const getTeamInfo = createServerFn()
|
||||
.inputValidator(z.string())
|
||||
.validator(z.string())
|
||||
.middleware([superTokensFunctionMiddleware])
|
||||
.handler(async ({ data: teamId }) =>
|
||||
toServerResult(() => pbAdmin.getTeamInfo(teamId))
|
||||
);
|
||||
|
||||
export const createTeam = createServerFn()
|
||||
.inputValidator(teamInputSchema)
|
||||
.validator(teamInputSchema)
|
||||
.middleware([superTokensFunctionMiddleware, serverFnLoggingMiddleware])
|
||||
.handler(async ({ data, context }) =>
|
||||
toServerResult(async () => {
|
||||
@@ -47,7 +47,7 @@ export const createTeam = createServerFn()
|
||||
);
|
||||
|
||||
export const updateTeam = createServerFn()
|
||||
.inputValidator(z.object({
|
||||
.validator(z.object({
|
||||
id: z.string(),
|
||||
updates: teamUpdateSchema
|
||||
}))
|
||||
@@ -73,14 +73,14 @@ export const updateTeam = createServerFn()
|
||||
);
|
||||
|
||||
export const getTeamStats = createServerFn()
|
||||
.inputValidator(z.string())
|
||||
.validator(z.string())
|
||||
.middleware([superTokensFunctionMiddleware])
|
||||
.handler(async ({ data: teamId }) =>
|
||||
toServerResult(() => pbAdmin.getTeamStats(teamId))
|
||||
);
|
||||
|
||||
export const getTeamMatches = createServerFn()
|
||||
.inputValidator(z.string())
|
||||
.validator(z.string())
|
||||
.middleware([superTokensFunctionMiddleware])
|
||||
.handler(async ({ data }) =>
|
||||
toServerResult<Match[]>(async () => await pbAdmin.getTeamMatches(data))
|
||||
|
||||
Reference in New Issue
Block a user