chore: contact us module
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { Injectable } from "@nestjs/common";
|
||||
import { InjectRepository } from "@nestjs/typeorm";
|
||||
import { Repository } from "typeorm";
|
||||
|
||||
import { ContactUs } from "../entities/contact-us.entity";
|
||||
|
||||
@Injectable()
|
||||
export class ContactUsRepository extends Repository<ContactUs> {
|
||||
constructor(@InjectRepository(ContactUs) contactUsRepository: Repository<ContactUs>) {
|
||||
super(contactUsRepository.target, contactUsRepository.manager, contactUsRepository.queryRunner);
|
||||
}
|
||||
|
||||
async getOneContactUs(id: string) {
|
||||
return await this.findOne({
|
||||
where: {
|
||||
id,
|
||||
},
|
||||
relations: ["user"],
|
||||
select: {
|
||||
id: true,
|
||||
numericId: true,
|
||||
title: true,
|
||||
content: true,
|
||||
isRead: true,
|
||||
createdAt: true,
|
||||
user: {
|
||||
id: true,
|
||||
email: true,
|
||||
firstName: true,
|
||||
lastName: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user