barname bug

This commit is contained in:
2026-03-08 11:01:56 +03:30
parent ae2b9a4ce1
commit ec04fa6158
3 changed files with 7 additions and 9 deletions
+2 -2
View File
@@ -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);
}
+3 -5
View File
@@ -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
+2 -2
View File
@@ -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;
//-----------------------------------