Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
fix(core): lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Juknum committed Oct 31, 2023
1 parent ac21a82 commit 3a8a891
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ This repository contains the source code of the API used by the [Sith 4](https:/
## Table of contents

- [Installation](#installation)
- [Project](#project)
- [Environment variables](#environment-variables)
- [Database](#database)
- [PostgreSQL Installation](#postgresql-installation)
- [Configuration](#configuration)
- [First time setup](#first-time-setup)
- [Project](#project)
- [Environment variables](#environment-variables)
- [Database](#database)
- [PostgreSQL Installation](#postgresql-installation)
- [Configuration](#configuration)
- [First time setup](#first-time-setup)
- [Launch](#launch)
- [Tests](#tests)
- [Linting](#linting)
Expand Down Expand Up @@ -79,13 +79,13 @@ brew services start postgresql@13 # start postgresql service

After the installation, you can use [pgAdmin](https://www.pgadmin.org/) to create a server with the following parameters:

| `.env` | pgAdmin 4 | value |
| :------------------: | :------------------: | :---------------------------------------------------------------------------------------- |
| `DB_HOST` | Host | `127.0.0.1` |
| `DB_PORT` | Port | `5432` |
| `DB_USERNAME` | Username | Should be the username you used to install postgresql or any user you have created for it |
| `DB_PASSWORD` | Password | leave it empty, unless you have set a password for your postgresql user |
| `DB_DATABASE` | Maintenance database | `postgres` |
| `.env` | pgAdmin 4 | value |
| :-----------: | :------------------: | :---------------------------------------------------------------------------------------- |
| `DB_HOST` | Host | `127.0.0.1` |
| `DB_PORT` | Port | `5432` |
| `DB_USERNAME` | Username | Should be the username you used to install postgresql or any user you have created for it |
| `DB_PASSWORD` | Password | leave it empty, unless you have set a password for your postgresql user |
| `DB_DATABASE` | Maintenance database | `postgres` |

> **Note**
> You can also use [TablePlus](https://tableplus.com/) to manage your databases as a lightweight (but more limited, in the free edition) alternative to pgAdmin.
Expand Down Expand Up @@ -121,6 +121,7 @@ pnpm run start:prod
```

## Tests

Both unit and e2e tests are available and run with [Jest](https://jestjs.io/). You can run them with the following command:

```bash
Expand All @@ -131,6 +132,7 @@ pnpm test
> After running the tests, a coverage report is generated in the `./coverage` folder.
## Linting

This project uses [ESLint](https://eslint.org/) and [Prettier](https://prettier.io/) to lint the code. You can run the linter with the following command:

```bash
Expand Down
7 changes: 6 additions & 1 deletion src/modules/files/files.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ import { MikroORM, CreateRequestContext, Loaded } from '@mikro-orm/core';
import { BadRequestException, Injectable, NotFoundException } from '@nestjs/common';
import { fromBuffer, MimeType } from 'file-type';

import { PromotionPicture } from '@modules/promotions/entities/promotion-picture.entity';
import { TranslateService } from '@modules/translate/translate.service';
import { UserBanner } from '@modules/users/entities/user-banner.entity';
import { UserPicture } from '@modules/users/entities/user-picture.entity';
import { User } from '@modules/users/entities/user.entity';
import { UsersDataService } from '@modules/users/services/users-data.service';

import { FileVisibilityGroup } from './entities/file-visibility.entity';
import { File, FileKind } from './entities/file.entity';
import { File } from './entities/file.entity';
import { ImagesService } from './images.service';

type WriteFileOptions = {
Expand All @@ -26,6 +29,8 @@ type WriteImageOptions = WriteFileOptions & {
aspect_ratio: aspect_ratio;
};

export type FileKind = UserPicture | UserBanner | PromotionPicture;

@Injectable()
export class FilesService {
constructor(
Expand Down

0 comments on commit 3a8a891

Please sign in to comment.