Updated the payment records screen for the corporate to make sure they can't see agent related stuff

This commit is contained in:
Tiago Ribeiro
2024-01-09 17:26:37 +00:00
parent f8f8ee5e13
commit 271364a939
2 changed files with 95 additions and 84 deletions

View File

@@ -14,7 +14,6 @@ const PaymentAssetManager = (props: {
type: FilesStorage;
reload: () => void;
paymentId: string;
canEdit: boolean;
}) => {
const {asset, permissions, type, paymentId} = props;
@@ -122,14 +121,10 @@ const PaymentAssetManager = (props: {
return (
<>
<BsDownload onClick={downloadAsset} />
{props.canEdit && (
<>
<BsArrowRepeat onClick={() => fileInputReplaceRef.current?.click()} />
<BsTrash onClick={deleteAsset} />
{renderFileInput((e: Event) => handleFileChange(e, "patch"), fileInputReplaceRef)}
{renderFileInput((e: Event) => handleFileChange(e, "post"), fileInputRef)}
</>
)}
<BsArrowRepeat onClick={() => fileInputReplaceRef.current?.click()} />
<BsTrash onClick={deleteAsset} />
{renderFileInput((e: Event) => handleFileChange(e, "patch"), fileInputReplaceRef)}
{renderFileInput((e: Event) => handleFileChange(e, "post"), fileInputRef)}
</>
);
}
@@ -137,7 +132,7 @@ const PaymentAssetManager = (props: {
return <span className="loading loading-infinity w-8" />;
}
return props.canEdit ? (
return permissions === "write" ? (
<>
<BsUpload onClick={() => fileInputRef.current?.click()} />
{renderFileInput((e: Event) => handleFileChange(e, "post"), fileInputRef)}