feat(admin) : streamline team editing and delete safety
CI / Verify (push) Successful in 1m1s
CI / Build immutable images and deploy (push) Successful in 1m58s

This commit is contained in:
2026-09-02 20:59:41 +07:00 Unverified
parent f212b6c935
commit c63b879ddb
7 changed files with 178 additions and 61 deletions
+6
View File
@@ -18,6 +18,12 @@ describe("structured guide validation", () => {
expect(weaponSectionSchema.safeParse({ expectedVersion: 1, note: null, rows: [{ weaponKey: "1", refinement: 5, overallPercent: 104, personalPercent: null, note: "Best free-to-play option" }] }).success).toBe(true);
});
it("preserves negative weapon percentages", () => {
const result = weaponSectionSchema.safeParse({ expectedVersion: 1, note: null, rows: [{ weaponKey: "1", refinement: 5, overallPercent: -12.5, personalPercent: null, note: null }] });
expect(result.success).toBe(true);
if (result.success) expect(result.data.rows[0].overallPercent).toBe(-12.5);
});
it("limits an optional note on each weapon", () => {
const row = { weaponKey: "1", refinement: 1, overallPercent: 100, personalPercent: null };
expect(weaponSectionSchema.safeParse({ expectedVersion: 1, note: null, rows: [{ ...row, note: null }] }).success).toBe(true);
+1 -1
View File
@@ -5,7 +5,7 @@ import { targetStatOptions } from "@/lib/guides/stats";
export const guideSectionKinds = ["weapon", "artifact", "constellations", "team"] as const;
export type GuideSectionKind = (typeof guideSectionKinds)[number];
const percent = z.coerce.number().finite().min(0).max(9999);
const percent = z.coerce.number().finite().min(-9999).max(9999);
const catalogKey = z.string().trim().min(1).max(64);
export const createGuideSchema = z.strictObject({