mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-12-22 16:30:13 +00:00
minimal fixes, thanks tests
This commit is contained in:
parent
f412a074ff
commit
ad8d916775
2 changed files with 3 additions and 2 deletions
|
@ -632,8 +632,8 @@ export class DriveService {
|
|||
|
||||
@bindThis
|
||||
public async updateFile(file: MiDriveFile, values: Partial<MiDriveFile>, updater: MiUser) {
|
||||
const profile = await this.userProfilesRepository.findOneBy({ userId: file.userId });
|
||||
const alwaysMarkNsfw = (await this.roleService.getUserPolicies(file.userId)).alwaysMarkNsfw || (profile !== null && profile!.alwaysMarkNsfw);
|
||||
const profile = file.userId ? await this.userProfilesRepository.findOneBy({ userId: file.userId }) : null;
|
||||
const alwaysMarkNsfw = file.userId ? (await this.roleService.getUserPolicies(file.userId)).alwaysMarkNsfw || (profile !== null && profile!.alwaysMarkNsfw) : false;
|
||||
|
||||
if (values.name != null && !this.driveFileEntityService.validateFileName(values.name)) {
|
||||
throw new DriveService.InvalidFileNameError();
|
||||
|
|
|
@ -16,6 +16,7 @@ import { MetaService } from '@/core/MetaService.js';
|
|||
import { FanoutTimelineEndpointService } from '@/core/FanoutTimelineEndpointService.js';
|
||||
import { MiLocalUser } from '@/models/User.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
import { Brackets } from 'typeorm';
|
||||
|
||||
export const meta = {
|
||||
tags: ['notes', 'channels'],
|
||||
|
|
Loading…
Reference in a new issue