chore: add company request
This commit is contained in:
@@ -4,7 +4,7 @@ import { BusinessMessage } from "../../../common/enums/message.enum";
|
||||
import { BusinessRepository } from "../repositories/business.repository";
|
||||
|
||||
@Injectable()
|
||||
export class BusinessService {
|
||||
export class BusinessesService {
|
||||
constructor(private readonly businessRepository: BusinessRepository) {}
|
||||
|
||||
async getBusinessByDanakSubscriptionId(danakSubscriptionId: string) {
|
||||
@@ -13,4 +13,11 @@ export class BusinessService {
|
||||
|
||||
return business;
|
||||
}
|
||||
|
||||
async getBusinessBySlug(slug: string) {
|
||||
const business = await this.businessRepository.findOne({ slug, deletedAt: null });
|
||||
if (!business) throw new BadRequestException(BusinessMessage.NOT_FOUND);
|
||||
|
||||
return { business };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user