Skip to content

Commit a49174a

Browse files
authored
Merge pull request #1185 from trycompai/claudio/fix-file-upload
[dev] [claudfuen] claudio/fix-file-upload
2 parents cf68c40 + e1f309f commit a49174a

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

apps/app/src/actions/safe-action.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,15 @@ export const authActionClient = actionClientWithMeta
154154
throw new Error('Member not found');
155155
}
156156

157+
const { fileData: _, ...inputForAuditLog } = clientInput as any;
158+
157159
const data = {
158160
userId: session.user.id,
159161
email: session.user.email,
160162
name: session.user.name,
161163
organizationId: session.session.activeOrganizationId,
162164
action: metadata.name,
163-
input: clientInput,
165+
input: inputForAuditLog,
164166
ipAddress: headersList.get('x-forwarded-for') || null,
165167
userAgent: headersList.get('user-agent') || null,
166168
};

apps/app/src/app/(app)/[orgId]/tasks/[taskId]/components/TaskBody.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ export function TaskBody({
4747
toast.success('File uploaded successfully');
4848
},
4949
onError: ({ error }) => {
50-
toast.error(error.serverError || 'Failed to upload file.');
50+
console.error('File upload failed:', error);
51+
toast.error(error.serverError || 'Failed to upload file. Check console for details.');
5152
},
5253
onSettled: () => {
5354
if (fileInputRef.current) {

apps/app/src/components/comments/CommentItem.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ export function CommentItem({ comment }: { comment: CommentWithAuthor }) {
6666
}
6767
},
6868
onError: ({ error }) => {
69-
toast.error(error.serverError || 'Failed to upload file.');
69+
console.error('File upload failed:', error);
70+
toast.error(error.serverError || 'Failed to upload file. Check console for details.');
7071
},
7172
onSettled: () => {
7273
if (fileInputRef.current) {

0 commit comments

Comments
 (0)