mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-19 13:08:23 +02:00
Add direct test button to create announcements with simplified validation
Introduce a direct test button in the AnnouncementCard component for easier debugging and validation testing. Replit-Commit-Author: Agent Replit-Commit-Session-Id: e437ffed-c31b-44eb-9fd5-b6f9faa8e7ce Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/e437ffed-c31b-44eb-9fd5-b6f9faa8e7ce/aVFsaJG
This commit is contained in:
1 parent
3134732cb2
commit
6be4e2a0e4
2 files changed
+23
-2
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 275 KiB |
@@ -19,8 +19,12 @@ import { z } from "zod";
|
|||||||
import { safeFormat, safeDate } from "@/lib/dateUtils";
|
import { safeFormat, safeDate } from "@/lib/dateUtils";
|
||||||
import { useToast } from "@/hooks/use-toast";
|
import { useToast } from "@/hooks/use-toast";
|
||||||
|
|
||||||
const formSchema = insertAnnouncementSchema.extend({
|
// Schéma simplifié pour tester
|
||||||
groupId: z.coerce.number().optional(),
|
const formSchema = z.object({
|
||||||
|
title: z.string().min(1, "Le titre est obligatoire"),
|
||||||
|
content: z.string().min(1, "Le contenu est obligatoire"),
|
||||||
|
priority: z.enum(["normal", "important", "urgent"]).default("normal"),
|
||||||
|
groupId: z.number().optional().nullable(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default function AnnouncementCard() {
|
export default function AnnouncementCard() {
|
||||||
@@ -284,6 +288,23 @@ export default function AnnouncementCard() {
|
|||||||
>
|
>
|
||||||
Annuler
|
Annuler
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
variant="secondary"
|
||||||
|
onClick={() => {
|
||||||
|
console.log('🔥 [TEST] Direct test button clicked');
|
||||||
|
const testData = {
|
||||||
|
title: "Test Direct",
|
||||||
|
content: "Test contenu direct",
|
||||||
|
priority: "normal" as const,
|
||||||
|
groupId: null,
|
||||||
|
};
|
||||||
|
console.log('🔥 [TEST] Test data:', testData);
|
||||||
|
createMutation.mutate(testData);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Test Direct
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={createMutation.isPending}
|
disabled={createMutation.isPending}
|
||||||
|
|||||||
Reference in new issue
Block a user