feat: Remove PDF field and upload functionality from ata creation and update.
This commit is contained in:
@@ -38,7 +38,6 @@
|
||||
);
|
||||
|
||||
// Document state
|
||||
let mainPdfFile: File | null = $state(null);
|
||||
let attachmentFiles: File[] = $state([]);
|
||||
let attachments = $state<Array<{ _id: Id<'atasDocumentos'>; nome: string; url: string | null }>>(
|
||||
[]
|
||||
@@ -73,7 +72,6 @@
|
||||
selectedObjetos = [];
|
||||
attachments = [];
|
||||
}
|
||||
mainPdfFile = null;
|
||||
attachmentFiles = [];
|
||||
searchObjeto = '';
|
||||
showModal = true;
|
||||
@@ -111,19 +109,13 @@
|
||||
}
|
||||
saving = true;
|
||||
try {
|
||||
let pdfStorageId = undefined;
|
||||
if (mainPdfFile) {
|
||||
pdfStorageId = await uploadFile(mainPdfFile);
|
||||
}
|
||||
|
||||
const payload = {
|
||||
numero: formData.numero,
|
||||
numeroSei: formData.numeroSei,
|
||||
empresaId: formData.empresaId as Id<'empresas'>,
|
||||
dataInicio: formData.dataInicio || undefined,
|
||||
dataFim: formData.dataFim || undefined,
|
||||
objetosIds: selectedObjetos,
|
||||
pdf: pdfStorageId
|
||||
objetosIds: selectedObjetos
|
||||
};
|
||||
|
||||
let ataId: Id<'atas'>;
|
||||
@@ -189,13 +181,6 @@
|
||||
return empresas.find((e) => e._id === id)?.razao_social || 'Empresa não encontrada';
|
||||
}
|
||||
|
||||
function handleFileSelect(e: Event) {
|
||||
const input = e.target as HTMLInputElement;
|
||||
if (input.files && input.files.length > 0) {
|
||||
mainPdfFile = input.files[0];
|
||||
}
|
||||
}
|
||||
|
||||
function handleAttachmentsSelect(e: Event) {
|
||||
const input = e.target as HTMLInputElement;
|
||||
if (input.files && input.files.length > 0) {
|
||||
@@ -372,19 +357,6 @@
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="mb-2 block text-sm font-bold text-gray-700" for="pdf">
|
||||
PDF da Ata {editingId ? '(Deixe em branco para manter o atual)' : ''}
|
||||
</label>
|
||||
<input
|
||||
class="focus:shadow-outline w-full appearance-none rounded border px-3 py-2 leading-tight text-gray-700 shadow focus:outline-none"
|
||||
id="pdf"
|
||||
type="file"
|
||||
accept=".pdf"
|
||||
onchange={handleFileSelect}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col">
|
||||
|
||||
Reference in New Issue
Block a user