mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
fix
This commit is contained in:
@@ -127,7 +127,6 @@ export default function TabPowerOfAttorney({
|
||||
// Save submits the file and the fields together, into one change request.
|
||||
const [pickedFile, setPickedFile] = useState<File | null>(null);
|
||||
const [removeIds, setRemoveIds] = useState<string[]>([]);
|
||||
const [letterError, setLetterError] = useState<string | null>(null);
|
||||
const [saveBlocked, setSaveBlocked] = useState(false);
|
||||
|
||||
/** Letters that will still be on file once the staged edits are applied. */
|
||||
@@ -176,7 +175,6 @@ export default function TabPowerOfAttorney({
|
||||
onSuccess: () => {
|
||||
setPickedFile(null);
|
||||
setRemoveIds([]);
|
||||
setLetterError(null);
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: api.companies.poaDelegation.queryKey(),
|
||||
});
|
||||
@@ -203,13 +201,14 @@ export default function TabPowerOfAttorney({
|
||||
setPickedFile(null);
|
||||
setRemoveIds([]);
|
||||
setSaveBlocked(false);
|
||||
setLetterError(null);
|
||||
};
|
||||
|
||||
const pickFile = (file: File) => {
|
||||
setLetterError(null);
|
||||
setSaveBlocked(false);
|
||||
setPickedFile(file);
|
||||
// An upload already supersedes every letter on file, so a pending explicit
|
||||
// removal would be a no-op — drop it rather than mislabel the row.
|
||||
setRemoveIds([]);
|
||||
};
|
||||
|
||||
const toggleRemove = (fileId: string) => {
|
||||
@@ -419,15 +418,6 @@ export default function TabPowerOfAttorney({
|
||||
</Text>
|
||||
</Group>
|
||||
)}
|
||||
{letterError && (
|
||||
<Group gap={6} c="red">
|
||||
<XCircle size={13} />
|
||||
<Text size="xs" fw={500}>
|
||||
{letterError}
|
||||
</Text>
|
||||
</Group>
|
||||
)}
|
||||
|
||||
<input
|
||||
ref={uploadInputRef}
|
||||
type="file"
|
||||
|
||||
Reference in New Issue
Block a user