mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-21 05:58:23 +02:00
Merge pull request #181 from R0m1k3/1.1
Add direct test button to create announcements with simplified valida…
This commit is contained in:
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