chore(docs): contributing (#1311)

* chore(server): linting

* chore: contributing pr checklist
This commit is contained in:
Jason Rasmussen
2023-01-12 09:44:11 -05:00
committed by GitHub
parent 131caa20eb
commit 67c52c3764
8 changed files with 97 additions and 36 deletions

View File

@@ -1,13 +1,13 @@
import {ApiProperty} from "@nestjs/swagger";
import {AlbumResponseDto} from "./album-response.dto";
import { ApiProperty } from '@nestjs/swagger';
import { AlbumResponseDto } from './album-response.dto';
export class AddAssetsResponseDto {
@ApiProperty({ type: 'integer' })
successfullyAdded!: number;
@ApiProperty({ type: 'integer' })
successfullyAdded!: number;
@ApiProperty()
alreadyInAlbum!: string[];
@ApiProperty()
alreadyInAlbum!: string[];
@ApiProperty()
album?: AlbumResponseDto;
}
@ApiProperty()
album?: AlbumResponseDto;
}

View File

@@ -1,7 +1,6 @@
export class CheckExistingAssetsResponseDto {
constructor(existingIds: string[]) {
this.existingIds = existingIds;
}
existingIds: string[];
constructor(existingIds: string[]) {
this.existingIds = existingIds;
}
existingIds: string[];
}

View File

@@ -5,7 +5,7 @@ import { UpdateTagDto } from './dto/update-tag.dto';
import { Authenticated } from '../../decorators/authenticated.decorator';
import { ApiTags } from '@nestjs/swagger';
import { AuthUserDto, GetAuthUser } from '../../decorators/auth-user.decorator';
import { mapTag, TagResponseDto } from "./response-dto/tag-response.dto";
import { mapTag, TagResponseDto } from './response-dto/tag-response.dto';
@Authenticated()
@ApiTags('Tag')
@@ -14,7 +14,10 @@ export class TagController {
constructor(private readonly tagService: TagService) {}
@Post()
create(@GetAuthUser() authUser: AuthUserDto, @Body(ValidationPipe) createTagDto: CreateTagDto): Promise<TagResponseDto> {
create(
@GetAuthUser() authUser: AuthUserDto,
@Body(ValidationPipe) createTagDto: CreateTagDto,
): Promise<TagResponseDto> {
return this.tagService.create(authUser, createTagDto);
}
@@ -34,7 +37,7 @@ export class TagController {
@GetAuthUser() authUser: AuthUserDto,
@Param('id') id: string,
@Body(ValidationPipe) updateTagDto: UpdateTagDto,
): Promise<TagResponseDto> {
): Promise<TagResponseDto> {
return this.tagService.update(authUser, id, updateTagDto);
}

View File

@@ -9,17 +9,16 @@ export const HumanReadableSize = { KiB, MiB, GiB, TiB, PiB };
export function asHumanReadable(bytes: number, precision = 1): string {
const units = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB'];
let magnitude = 0;
let remainder = bytes;
while (remainder >= 1024) {
if (magnitude + 1 < units.length) {
magnitude++;
remainder /= 1024;
}
else {
break;
}
}
let magnitude = 0;
let remainder = bytes;
while (remainder >= 1024) {
if (magnitude + 1 < units.length) {
magnitude++;
remainder /= 1024;
} else {
break;
}
}
return `${remainder.toFixed( magnitude == 0 ? 0 : precision )} ${units[magnitude]}`;
return `${remainder.toFixed(magnitude == 0 ? 0 : precision)} ${units[magnitude]}`;
}