mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-23 06:58:19 +02:00
2 files changed
+8
-3
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 275 KiB |
@@ -39,7 +39,7 @@ type TaskWithRelations = Task & {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Composant TaskForm inline - Version production ultra-simple
|
// Composant TaskForm inline - Version production ultra-simple
|
||||||
function TaskFormInline({ task, onClose }: any) {
|
function TaskFormInline({ task, onClose, selectedStoreId, user }: any) {
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
|
const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -90,8 +90,9 @@ function TaskFormInline({ task, onClose }: any) {
|
|||||||
const method = task ? 'PUT' : 'POST';
|
const method = task ? 'PUT' : 'POST';
|
||||||
|
|
||||||
if (!task) {
|
if (!task) {
|
||||||
(taskData as any).groupId = 1;
|
// Utiliser le magasin sélectionné ou le premier disponible comme fallback
|
||||||
(taskData as any).createdBy = 'admin';
|
(taskData as any).groupId = selectedStoreId ? parseInt(selectedStoreId.toString()) : 1;
|
||||||
|
(taskData as any).createdBy = user?.username || 'admin';
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('📤 Sending request:', { url, method, taskData });
|
console.log('📤 Sending request:', { url, method, taskData });
|
||||||
@@ -778,6 +779,8 @@ export default function Tasks() {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<TaskFormInline
|
<TaskFormInline
|
||||||
|
selectedStoreId={selectedStoreId}
|
||||||
|
user={user}
|
||||||
onClose={() => setShowCreateModal(false)}
|
onClose={() => setShowCreateModal(false)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -1324,6 +1327,8 @@ export default function Tasks() {
|
|||||||
</div>
|
</div>
|
||||||
<TaskFormInline
|
<TaskFormInline
|
||||||
task={selectedTask}
|
task={selectedTask}
|
||||||
|
selectedStoreId={selectedStoreId}
|
||||||
|
user={user}
|
||||||
onClose={() => {
|
onClose={() => {
|
||||||
setShowEditModal(false);
|
setShowEditModal(false);
|
||||||
setSelectedTask(null);
|
setSelectedTask(null);
|
||||||
|
|||||||
Reference in new issue
Block a user