fix(types): resolver any warnings em useApontamentosProducao
This commit is contained in:
@@ -317,7 +317,19 @@ export const useApontamentosProducao = () => {
|
|||||||
|
|
||||||
console.log('🔄 Criando apontamento:', apontamento);
|
console.log('🔄 Criando apontamento:', apontamento);
|
||||||
|
|
||||||
const insertData: any = {
|
interface InsertApontamentoData {
|
||||||
|
of_number: string;
|
||||||
|
tipo_apontamento: 'peca' | 'componente';
|
||||||
|
processo_id: string;
|
||||||
|
quantidade_produzida: number;
|
||||||
|
data_apontamento: string;
|
||||||
|
observacoes?: string | null;
|
||||||
|
created_by?: string;
|
||||||
|
peca_id?: string | null;
|
||||||
|
componente_id?: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const insertData: InsertApontamentoData = {
|
||||||
of_number: apontamento.of_number,
|
of_number: apontamento.of_number,
|
||||||
tipo_apontamento: apontamento.tipo_apontamento,
|
tipo_apontamento: apontamento.tipo_apontamento,
|
||||||
processo_id: apontamento.processo_id,
|
processo_id: apontamento.processo_id,
|
||||||
@@ -371,7 +383,8 @@ export const useApontamentosProducao = () => {
|
|||||||
return { success: true };
|
return { success: true };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('❌ Erro ao criar apontamento:', error);
|
console.error('❌ Erro ao criar apontamento:', error);
|
||||||
toast.error('Erro ao registrar apontamento: ' + (error as any).message);
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
||||||
|
toast.error('Erro ao registrar apontamento: ' + errorMessage);
|
||||||
return { success: false, error };
|
return { success: false, error };
|
||||||
}
|
}
|
||||||
}, [user, fetchApontamentos]);
|
}, [user, fetchApontamentos]);
|
||||||
|
|||||||
Reference in New Issue
Block a user