chore(api): update dependencies

This commit is contained in:
Julian Tölle 2020-05-02 17:17:20 +02:00
parent 05f230a7ce
commit d881a78757
37 changed files with 4804 additions and 2700 deletions

View file

@ -12,6 +12,6 @@ export class User {
@Column({ nullable: true })
photo?: string;
@Column(type => SpotifyConnection)
@Column((type) => SpotifyConnection)
spotify: SpotifyConnection;
}

View file

@ -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();
});
});

View file

@ -11,7 +11,7 @@ export class UsersController {
return {
id: user.id,
displayName: user.displayName,
photo: user.photo
photo: user.photo,
};
}
}

View file

@ -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 {}

View file

@ -6,7 +6,7 @@ describe("UsersService", () => {
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [UsersService]
providers: [UsersService],
}).compile();
service = module.get<UsersService>(UsersService);

View file

@ -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,
},
});
}