Fix - Remove signFileUrl method (#19121)

`signFileUrl` is the old way to resolve file url. Replaced by
`signFileByIdUrl` which needs `FileFolder` and `fileId`.

Fix also avatar for person and workspaceMember. To be continued with
imageIdentifier refactor.


Fix : 
- https://discord.com/channels/1130383047699738754/1486723854910099576
- https://discord.com/channels/1130383047699738754/1484566445584285870
- https://discord.com/channels/1130383047699738754/1487124612889313420

---------

Co-authored-by: Charles Bochet <charlesBochet@users.noreply.github.com>
This commit is contained in:
Etienne
2026-03-30 17:14:54 +02:00
committed by GitHub
parent 3d1c53ec9d
commit ecf8161d0e
20 changed files with 175 additions and 195 deletions
@@ -1,31 +0,0 @@
import { type QueryResultGetterHandlerInterface } from 'src/engine/api/graphql/workspace-query-runner/factories/query-result-getters/interfaces/query-result-getter-handler.interface';
import { type FileService } from 'src/engine/core-modules/file/services/file.service';
import { type AttachmentWorkspaceEntity } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
export class AttachmentQueryResultGetterHandler
implements QueryResultGetterHandlerInterface
{
constructor(private readonly fileService: FileService) {}
async handle(
attachment: AttachmentWorkspaceEntity,
workspaceId: string,
): Promise<AttachmentWorkspaceEntity> {
if (!attachment.id || !attachment?.fullPath) {
return attachment;
}
const signedPath = this.fileService.signFileUrl({
url: attachment.fullPath,
workspaceId,
});
const fullPath = `${process.env.SERVER_URL}/files/${signedPath}`;
return {
...attachment,
fullPath,
};
}
}
@@ -1,29 +0,0 @@
import { type QueryResultGetterHandlerInterface } from 'src/engine/api/graphql/workspace-query-runner/factories/query-result-getters/interfaces/query-result-getter-handler.interface';
import { type FileService } from 'src/engine/core-modules/file/services/file.service';
import { type PersonWorkspaceEntity } from 'src/modules/person/standard-objects/person.workspace-entity';
export class PersonQueryResultGetterHandler
implements QueryResultGetterHandlerInterface
{
constructor(private readonly fileService: FileService) {}
async handle(
person: PersonWorkspaceEntity,
workspaceId: string,
): Promise<PersonWorkspaceEntity> {
if (!person.id || !person?.avatarUrl) {
return person;
}
const signedPath = this.fileService.signFileUrl({
url: person.avatarUrl,
workspaceId,
});
return {
...person,
avatarUrl: signedPath,
};
}
}