lint
This commit is contained in:
@@ -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> {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user