test: update debug lines

This commit is contained in:
Mar0xy 2023-10-30 00:45:38 +01:00
parent e8e4bafa64
commit be7d3859c3
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828

View file

@ -258,8 +258,9 @@ export class MastodonApiServerService {
try {
if (_request.files.length > 0 && accessTokens) {
const tokeninfo = await this.accessTokensRepository.findOneBy({ token: accessTokens.replace('Bearer ', '') });
console.error(tokeninfo);
console.error(_request.files);
if (tokeninfo && (_request.files as any)['avatar']) {
console.error('avatar');
const file = toSingleLast((_request.files as any)['avatar']);
const upload = await this.driveService.addFile({
user: { id: tokeninfo.userId, host: null },
@ -267,6 +268,7 @@ export class MastodonApiServerService {
name: file.originalname !== null && file.originalname !== 'file' ? file.originalname : undefined,
sensitive: false,
});
console.error(upload);
if (upload.type.startsWith('image/')) {
(_request.body as any).avatar = upload.id;
}