From 05e4ef9f6bbf2709d7cb97470859eb8fc204063c Mon Sep 17 00:00:00 2001 From: Flo's linting bot Date: Wed, 12 Jun 2024 21:30:22 +0000 Subject: [PATCH] Automated linting for pr #tailwindify-every-route --- server/src/dto/diary.dto.ts | 2 +- server/src/entities/diary.entity.ts | 2 +- server/src/interfaces/diary.interface.ts | 3 +- server/src/repositories/diary.repository.ts | 4 +- server/src/services/diary.service.ts | 10 +-- web/src/lib/Navbar.svelte | 4 +- web/src/lib/UserPageLayout.svelte | 7 +- .../shared-components/selector.svelte | 75 ++++++++++--------- .../shared-components/sidebar-link.svelte | 6 +- web/src/lib/modals/CustomModal.svelte | 6 +- 10 files changed, 60 insertions(+), 59 deletions(-) diff --git a/server/src/dto/diary.dto.ts b/server/src/dto/diary.dto.ts index d00f169..8320613 100644 --- a/server/src/dto/diary.dto.ts +++ b/server/src/dto/diary.dto.ts @@ -1,5 +1,5 @@ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; -import { IsDateString, IsInt, IsNotEmpty, IsNumber, IsOptional, IsString, Max, Min, ValidateIf } from 'class-validator'; +import { IsDateString, IsNotEmpty, IsNumber, IsOptional, IsString, Max, Min, ValidateIf } from 'class-validator'; import { string } from 'joi'; import { DiaryEncryption, DiaryEntity } from 'src/entities/diary.entity'; diff --git a/server/src/entities/diary.entity.ts b/server/src/entities/diary.entity.ts index 5d1a23a..70fe400 100644 --- a/server/src/entities/diary.entity.ts +++ b/server/src/entities/diary.entity.ts @@ -39,4 +39,4 @@ export class DiaryEntity { @Column({ type: 'varchar', default: DiaryEncryption.NONE }) encryption: DiaryEncryption; -} \ No newline at end of file +} diff --git a/server/src/interfaces/diary.interface.ts b/server/src/interfaces/diary.interface.ts index b7a627b..81be530 100644 --- a/server/src/interfaces/diary.interface.ts +++ b/server/src/interfaces/diary.interface.ts @@ -1,4 +1,3 @@ -import { AuthDto } from 'src/dto/auth.dto'; import { DiaryEntity } from 'src/entities/diary.entity'; import { UserEntity } from 'src/entities/user.entity'; @@ -10,4 +9,4 @@ export interface IDiaryRepository { delete(id: string); } -export const IDiaryRepository = 'IDiaryRepository'; \ No newline at end of file +export const IDiaryRepository = 'IDiaryRepository'; diff --git a/server/src/repositories/diary.repository.ts b/server/src/repositories/diary.repository.ts index e50bf4f..fbaa095 100644 --- a/server/src/repositories/diary.repository.ts +++ b/server/src/repositories/diary.repository.ts @@ -1,4 +1,4 @@ -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { DiaryEntity } from 'src/entities/diary.entity'; import { UserEntity } from 'src/entities/user.entity'; @@ -44,4 +44,4 @@ export class DiaryRepository implements IDiaryRepository { const { id } = await this.diaryRepository.save(user); return this.diaryRepository.findOneOrFail({ where: { id }, withDeleted: true }); } -} \ No newline at end of file +} diff --git a/server/src/services/diary.service.ts b/server/src/services/diary.service.ts index ac113f2..2fd8278 100644 --- a/server/src/services/diary.service.ts +++ b/server/src/services/diary.service.ts @@ -8,28 +8,28 @@ export class DiaryService { constructor(@Inject(IDiaryRepository) private diaryRepository: IDiaryRepository) {} async create(auth: AuthDto, dto: DiaryCreateDto): Promise { - let diary = await this.diaryRepository.getByDateAndUser(dto.date, auth.user); + const diary = await this.diaryRepository.getByDateAndUser(dto.date, auth.user); if (diary) throw new BadRequestException('Diary entry already exists'); return this.diaryRepository.create({ ...dto, user: auth.user }).then(mapDiary); } async delete(auth: AuthDto, date: string): Promise { - let diary = await this.diaryRepository.getByDateAndUser(date, auth.user); + const diary = await this.diaryRepository.getByDateAndUser(date, auth.user); if (!diary) throw new BadRequestException('Diary not found'); return this.diaryRepository.delete(diary.id); } async edit(auth: AuthDto, date: string, dto: DiaryEditDto) { - let diary = await this.diaryRepository.getByDateAndUser(date, auth.user); + const diary = await this.diaryRepository.getByDateAndUser(date, auth.user); if (!diary) throw new BadRequestException('Diary not found'); return mapDiary(await this.diaryRepository.update({ id: diary.id, ...dto })); } async get(auth: AuthDto, date: string) { - let diary = await this.diaryRepository.getByDateAndUser(date, auth.user); + const diary = await this.diaryRepository.getByDateAndUser(date, auth.user); if (!diary) throw new BadRequestException('Diary not found'); return mapDiary(diary); @@ -42,4 +42,4 @@ export class DiaryService { diaries: diaries.map((diary) => mapDiary(diary)), }; } -} \ No newline at end of file +} diff --git a/web/src/lib/Navbar.svelte b/web/src/lib/Navbar.svelte index 633bcfe..0d2cf7a 100644 --- a/web/src/lib/Navbar.svelte +++ b/web/src/lib/Navbar.svelte @@ -10,9 +10,7 @@ >

PRM

- -
-
+
diff --git a/web/src/lib/UserPageLayout.svelte b/web/src/lib/UserPageLayout.svelte index 8a89706..b885c7c 100644 --- a/web/src/lib/UserPageLayout.svelte +++ b/web/src/lib/UserPageLayout.svelte @@ -3,12 +3,11 @@ import Navbar from '$lib/Navbar.svelte'; export let hideNavbar = false; -
{#if !hideNavbar} - + {/if} @@ -18,10 +17,10 @@ class="relative grid h-screen grid-cols-[theme(spacing.18)_auto] overflow-hidden bg-prm-bg pt-[var(--navbar-height)] md:grid-cols-[theme(spacing.64)_auto]" > - +
- +
diff --git a/web/src/lib/components/shared-components/selector.svelte b/web/src/lib/components/shared-components/selector.svelte index 6390d4e..ed909ad 100644 --- a/web/src/lib/components/shared-components/selector.svelte +++ b/web/src/lib/components/shared-components/selector.svelte @@ -1,5 +1,4 @@ +
+
+ {@html content} +
+ + {#if $showSuggestions} +
+ {#each $suggestions as contact, index} +
selectSuggestion(contact)} + > + {`${contact.name} ${contact.lastname}`} +
+ {/each} +
+ {/if} +
+ - -
-
{@html content}
- - {#if $showSuggestions} -
- {#each $suggestions as contact, index} -
selectSuggestion(contact)} - > - {`${contact.name} ${contact.lastname}`} -
- {/each} -
- {/if} -
diff --git a/web/src/lib/components/shared-components/sidebar-link.svelte b/web/src/lib/components/shared-components/sidebar-link.svelte index 6b912de..084cb9a 100644 --- a/web/src/lib/components/shared-components/sidebar-link.svelte +++ b/web/src/lib/components/shared-components/sidebar-link.svelte @@ -12,7 +12,9 @@ let currentTab = 'home'; let path = $page.url.pathname; - if (path == '/diary') currentTab = 'diary'; + if (path == '/diary') { + currentTab = 'diary'; + }
@@ -135,4 +137,4 @@ top: 6vh; } } - \ No newline at end of file + diff --git a/web/src/lib/modals/CustomModal.svelte b/web/src/lib/modals/CustomModal.svelte index bb8ad11..be8e48c 100644 --- a/web/src/lib/modals/CustomModal.svelte +++ b/web/src/lib/modals/CustomModal.svelte @@ -1,9 +1,9 @@