Drop await usage for now-synchronous encodeFileToken() (#11612)
### Remove unnecessary `await` from `encodeFileToken` calls (now
synchronous) #11611
#### Context
In [PR #11385 – commit
26c17f3](26c17f3205),
`FileService.encodeFileToken()` was updated to be a **synchronous**
method. However, several places in the codebase were still calling it
using `await`.
#### Changes
This PR cleans up those redundant `await` usages to:
- Improve clarity
- Avoid confusion (no longer awaiting a non-Promise)
- Slightly reduce overhead in affected functions
- Removed `await` from calls to `this.fileService.encodeFileToken(...)`
This commit is contained in:
@ -181,7 +181,7 @@ export class UserResolver {
|
||||
);
|
||||
|
||||
if (workspaceMember && workspaceMember.avatarUrl) {
|
||||
const avatarUrlToken = await this.fileService.encodeFileToken({
|
||||
const avatarUrlToken = this.fileService.encodeFileToken({
|
||||
workspaceMemberId: workspaceMember.id,
|
||||
workspaceId: workspace.id,
|
||||
});
|
||||
@ -233,7 +233,7 @@ export class UserResolver {
|
||||
|
||||
for (const workspaceMemberEntity of workspaceMemberEntities) {
|
||||
if (workspaceMemberEntity.avatarUrl) {
|
||||
const avatarUrlToken = await this.fileService.encodeFileToken({
|
||||
const avatarUrlToken = this.fileService.encodeFileToken({
|
||||
workspaceMemberId: workspaceMemberEntity.id,
|
||||
workspaceId: workspace.id,
|
||||
});
|
||||
@ -318,7 +318,7 @@ export class UserResolver {
|
||||
workspaceId,
|
||||
});
|
||||
|
||||
const fileToken = await this.fileService.encodeFileToken({
|
||||
const fileToken = this.fileService.encodeFileToken({
|
||||
workspaceId: workspaceId,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user