This commit is contained in:
vigdorov
2020-07-02 21:26:37 +03:00
commit 4d34b4a0bb
18 changed files with 13319 additions and 0 deletions

View File

@ -0,0 +1,25 @@
import { Controller, Get, Post, Body, Param } from '@nestjs/common';
import {StoreService} from './store.service';
import {Store, StoreParams} from './store.schema';
@Controller('store')
export class StoreController {
constructor(
private readonly storeService: StoreService
) {}
@Get()
async findAll(): Promise<Store[]> {
return this.storeService.findAll();
}
@Get(':key?')
async findOne(@Param() {key}: {key: string}): Promise<Store> {
return this.storeService.findOne(key);
}
@Post()
async create(@Body() createStoreClass: StoreParams): Promise<Store> {
return this.storeService.create(createStoreClass);
}
}