-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Context UploadFile now returns the file token which we don't want when we save the attachment in the DB due to its non-persistence so now the FE removes the token query param before saving the attachment. This is most likely not the right way to do it, we will need to refactor this part before. Also made sure we don't save the token in the DB for rich_text as well and remove it before saving.
- Loading branch information
Showing
3 changed files
with
49 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...wenty-front/src/modules/activities/files/hooks/__tests__/useUploadAttachmentFile.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { computePathWithoutToken } from '../useUploadAttachmentFile'; | ||
|
||
describe('computePathWithoutToken', () => { | ||
it('should remove token from path', () => { | ||
const input = 'https://example.com/image.jpg?token=abc123'; | ||
const expected = 'https://example.com/image.jpg'; | ||
expect(computePathWithoutToken(input)).toBe(expected); | ||
}); | ||
|
||
it('should handle path without token', () => { | ||
const input = 'https://example.com/image.jpg?size=large'; | ||
expect(computePathWithoutToken(input)).toBe(input); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters