mirror of
https://github.com/apricote/Listory.git
synced 2026-01-13 21:21:02 +00:00
chore(api): update dependencies
This commit is contained in:
parent
05f230a7ce
commit
d881a78757
37 changed files with 4804 additions and 2700 deletions
|
|
@ -12,6 +12,6 @@ export class User {
|
|||
@Column({ nullable: true })
|
||||
photo?: string;
|
||||
|
||||
@Column(type => SpotifyConnection)
|
||||
@Column((type) => SpotifyConnection)
|
||||
spotify: SpotifyConnection;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { UsersController } from './users.controller';
|
||||
import { Test, TestingModule } from "@nestjs/testing";
|
||||
import { UsersController } from "./users.controller";
|
||||
|
||||
describe('Users Controller', () => {
|
||||
describe("Users Controller", () => {
|
||||
let controller: UsersController;
|
||||
|
||||
beforeEach(async () => {
|
||||
|
|
@ -12,7 +12,7 @@ describe('Users Controller', () => {
|
|||
controller = module.get<UsersController>(UsersController);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
it("should be defined", () => {
|
||||
expect(controller).toBeDefined();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ export class UsersController {
|
|||
return {
|
||||
id: user.id,
|
||||
displayName: user.displayName,
|
||||
photo: user.photo
|
||||
photo: user.photo,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@ import { Module } from "@nestjs/common";
|
|||
import { TypeOrmModule } from "@nestjs/typeorm";
|
||||
import { UserRepository } from "./user.repository";
|
||||
import { UsersService } from "./users.service";
|
||||
import { UsersController } from './users.controller';
|
||||
import { UsersController } from "./users.controller";
|
||||
|
||||
@Module({
|
||||
imports: [TypeOrmModule.forFeature([UserRepository])],
|
||||
providers: [UsersService],
|
||||
exports: [UsersService],
|
||||
controllers: [UsersController]
|
||||
controllers: [UsersController],
|
||||
})
|
||||
export class UsersModule {}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ describe("UsersService", () => {
|
|||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [UsersService]
|
||||
providers: [UsersService],
|
||||
}).compile();
|
||||
|
||||
service = module.get<UsersService>(UsersService);
|
||||
|
|
|
|||
|
|
@ -24,14 +24,14 @@ export class UsersService {
|
|||
|
||||
async createOrUpdate(data: CreateOrUpdateDto): Promise<User> {
|
||||
let user = await this.userRepository.findOne({
|
||||
where: { spotify: { id: data.spotify.id } }
|
||||
where: { spotify: { id: data.spotify.id } },
|
||||
});
|
||||
|
||||
if (!user) {
|
||||
user = this.userRepository.create({
|
||||
spotify: {
|
||||
id: data.spotify.id
|
||||
}
|
||||
id: data.spotify.id,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue