Compare commits
No commits in common. '199c2b35a21cb8c56b4ab408f6451da8f5d63031' and '30eb685e9e86af7948a785afb798b9c9dc6a21b8' have entirely different histories.
199c2b35a2
...
30eb685e9e
7 changed files with 11 additions and 82 deletions
@ -1,8 +0,0 @@ |
||||
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'; |
||||
import { CartService } from './cart.service'; |
||||
|
||||
@Controller('cart') |
||||
export class CartController { |
||||
constructor(private readonly cartService: CartService) {} |
||||
|
||||
} |
@ -1,12 +0,0 @@ |
||||
import { Module } from "@nestjs/common"; |
||||
import { CartService } from "./cart.service"; |
||||
import { CartController } from "./cart.controller"; |
||||
import { Cart } from "./entities/cart.entity"; |
||||
import { SequelizeModule } from "@nestjs/sequelize"; |
||||
|
||||
@Module({ |
||||
imports: [SequelizeModule.forFeature([Cart])], |
||||
controllers: [CartController], |
||||
providers: [CartService], |
||||
}) |
||||
export class CartModule {} |
@ -1,7 +0,0 @@ |
||||
import { Injectable } from '@nestjs/common'; |
||||
|
||||
|
||||
@Injectable() |
||||
export class CartService { |
||||
|
||||
} |
@ -1,23 +0,0 @@ |
||||
import { Model, Table, Column, ForeignKey, BelongsTo } from "sequelize-typescript"; |
||||
import { User } from "../../users/entities/user.entity"; |
||||
import { Product } from "../../products/entities/product.entity"; |
||||
|
||||
@Table |
||||
export class Cart extends Model<Cart> { |
||||
@ForeignKey(() => User) |
||||
@Column |
||||
userId: number; |
||||
|
||||
@BelongsTo(() => User) |
||||
user: User; |
||||
|
||||
@ForeignKey(() => Product) |
||||
@Column |
||||
productId: number; |
||||
|
||||
@BelongsTo(() => Product) |
||||
product: Product; |
||||
|
||||
@Column |
||||
quantity: number; |
||||
} |
Loading…
Reference in new issue