This commit is contained in:
2025-12-13 11:14:18 +03:30
parent 3eb6b889a4
commit c25a5afe01
80 changed files with 440 additions and 190 deletions
@@ -25,7 +25,14 @@ export class ContactController {
@Post('public/contact')
@ApiOperation({ summary: 'Create a new contact (public endpoint)' })
@ApiHeader({ name: 'X-Slug', required: true, description: 'Restaurant slug identifier', example: 'zhivan' })
@ApiHeader({
name: 'X-Slug',
required: true,
schema: {
type: 'string',
default: 'zhivan',
},
})
async create(@Body() createContactDto: CreateContactDto) {
return this.contactService.create(createContactDto);
}
@@ -39,4 +39,3 @@ export class FindContactsDto {
@ApiPropertyOptional({ enum: ContactStatusEnum, description: 'Filter by status' })
status?: ContactStatusEnum;
}
@@ -8,4 +8,3 @@ export class UpdateContactStatusDto {
@ApiProperty({ enum: ContactStatusEnum, description: 'New status for the contact' })
status!: ContactStatusEnum;
}
@@ -37,11 +37,7 @@ export class ContactRepository extends EntityRepository<Contact> {
if (search) {
const pattern = `%${search}%`;
where.$or = [
{ subject: { $ilike: pattern } },
{ content: { $ilike: pattern } },
{ phone: { $ilike: pattern } },
];
where.$or = [{ subject: { $ilike: pattern } }, { content: { $ilike: pattern } }, { phone: { $ilike: pattern } }];
}
const [data, total] = await this.findAndCount(where, {
@@ -63,4 +59,3 @@ export class ContactRepository extends EntityRepository<Contact> {
};
}
}