mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-26 18:43:08 +02:00
upd: remove host lookup on file updating
This commit is contained in:
parent
2aa7c1ae34
commit
e8e4bafa64
1 changed files with 2 additions and 4 deletions
|
@ -261,9 +261,8 @@ export class MastodonApiServerService {
|
||||||
console.error(tokeninfo);
|
console.error(tokeninfo);
|
||||||
if (tokeninfo && (_request.files as any)['avatar']) {
|
if (tokeninfo && (_request.files as any)['avatar']) {
|
||||||
const file = toSingleLast((_request.files as any)['avatar']);
|
const file = toSingleLast((_request.files as any)['avatar']);
|
||||||
const user = await this.usersRepository.findOneBy({ id: tokeninfo.userId });
|
|
||||||
const upload = await this.driveService.addFile({
|
const upload = await this.driveService.addFile({
|
||||||
user: { id: tokeninfo.userId, host: user ? user.host : null },
|
user: { id: tokeninfo.userId, host: null },
|
||||||
path: file.path,
|
path: file.path,
|
||||||
name: file.originalname !== null && file.originalname !== 'file' ? file.originalname : undefined,
|
name: file.originalname !== null && file.originalname !== 'file' ? file.originalname : undefined,
|
||||||
sensitive: false,
|
sensitive: false,
|
||||||
|
@ -274,9 +273,8 @@ export class MastodonApiServerService {
|
||||||
}
|
}
|
||||||
if (tokeninfo && (_request.files as any)['header']) {
|
if (tokeninfo && (_request.files as any)['header']) {
|
||||||
const file = toSingleLast((_request.files as any)['header']);
|
const file = toSingleLast((_request.files as any)['header']);
|
||||||
const user = await this.usersRepository.findOneBy({ id: tokeninfo.userId });
|
|
||||||
const upload = await this.driveService.addFile({
|
const upload = await this.driveService.addFile({
|
||||||
user: { id: tokeninfo.userId, host: user ? user.host : null },
|
user: { id: tokeninfo.userId, host: null },
|
||||||
path: file.path,
|
path: file.path,
|
||||||
name: file.originalname !== null && file.originalname !== 'file' ? file.originalname : undefined,
|
name: file.originalname !== null && file.originalname !== 'file' ? file.originalname : undefined,
|
||||||
sensitive: false,
|
sensitive: false,
|
||||||
|
|
Loading…
Reference in a new issue