barname bug
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import {
|
||||
Body, Controller, Delete, Get, Param, Post,
|
||||
Body, Controller, Delete, Get, Param, Post,Patch,
|
||||
Query, UseInterceptors
|
||||
} from "@nestjs/common";
|
||||
import { ApiHeader, ApiOperation } from "@nestjs/swagger";
|
||||
@@ -45,7 +45,7 @@ export class BarnameController {
|
||||
}
|
||||
|
||||
@ApiOperation({ summary: "Update Barname by watcher" })
|
||||
@Get(":id/watcher")
|
||||
@Patch(":id/watcher")
|
||||
update(@Param('id') id: string, @BusinessDec() business: Business, @Body() dto: UpdateBarnameAsWatcherDto, @UserDec("role") role: RoleEnum) {
|
||||
return this.barnameService.updateBarnameAsWatcher(id, dto, business, role);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import { BarnameStatus } from "./enums/bill-type.enum";
|
||||
import { UpdateBarnameAsWatcherDto } from "./dto/update-barname-watcher.dto";
|
||||
import { RoleEnum } from "../users/enums/role.enum";
|
||||
import { User } from "../users/entities/user.entity";
|
||||
// import { CompaniesService } from "../companies/services/companies.service";
|
||||
|
||||
|
||||
@Injectable()
|
||||
@@ -22,7 +21,6 @@ export class BarnameService {
|
||||
|
||||
constructor(
|
||||
private readonly em: EntityManager,
|
||||
// private readonly companiesService: CompaniesService,
|
||||
private readonly barnameRepository: BarnameRepository,
|
||||
) { }
|
||||
|
||||
@@ -61,9 +59,9 @@ export class BarnameService {
|
||||
|
||||
const barname = await this.findOne(id, business.id)
|
||||
|
||||
if (exitedAt) {
|
||||
barname.exitedAt = exitedAt
|
||||
}
|
||||
barname.exitedAt = exitedAt
|
||||
|
||||
barname.status = BarnameStatus.COMPLETED
|
||||
|
||||
if (watcherDescription) {
|
||||
barname.watcherDescription = watcherDescription
|
||||
|
||||
@@ -56,8 +56,8 @@ export class User extends BaseEntity {
|
||||
|
||||
//-----------------------------------
|
||||
|
||||
@OneToOne(() => Company, (company) => company.user, { orphanRemoval: true })
|
||||
company!: Company & Opt;
|
||||
@OneToOne(() => Company, (company) => company.user, { orphanRemoval: true, nullable: true })
|
||||
company?: Company;
|
||||
|
||||
//-----------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user