This commit is contained in:
Rudhra Deep Biswas 2025-04-10 13:03:33 +05:30 committed by GitHub
parent 9ba29c5144
commit 3ac43a6bc9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 16 deletions

View file

@ -2,16 +2,21 @@ import HttpClient from '@/_helpers/http-client';
const adapter = new HttpClient();
//Uncomment when Comment Notifications Module is ready
function findAll(isRead = false) {
return adapter.get(`/comment_notifications?isRead=${isRead}`);
return { data: [] };
// return adapter.get(`/comment_notifications?isRead=${isRead}`);
}
function updateAll(isRead) {
return adapter.patch(`/comment_notifications`, { isRead });
return;
// return adapter.patch(`/comment_notifications`, { isRead });
}
function update(id, isRead) {
return adapter.patch(`/comment_notifications/${id}`, { isRead });
return;
// return adapter.patch(`/comment_notifications/${id}`, { isRead });
}
export const commentNotificationsService = {

View file

@ -420,11 +420,7 @@ export class DataQueriesUtilService implements IDataQueriesUtilService {
}
// c: Replace all occurrences of {{ }} variables
if (
typeof resolvedValue === 'string' &&
resolvedValue?.match(/\{\{(.*?)\}\}/g)?.length > 0 &&
!(resolvedValue.startsWith('{{') && resolvedValue.endsWith('}}'))
) {
if (typeof resolvedValue === 'string' && resolvedValue?.match(/\{\{(.*?)\}\}/g)?.length > 0) {
const variables = resolvedValue.match(/\{\{(.*?)\}\}/g);
for (const variable of variables || []) {

View file

@ -271,7 +271,7 @@ export default class LicenseBase {
}
public get ai(): object {
return this._ai;
return this._ai || {};
}
public get aiFeature(): boolean {

View file

@ -39,14 +39,19 @@ export class UserRepository extends Repository<User> {
if (options?.status) {
findOptions.status = options?.status;
}
const whereConditions = [];
// For the search query, create an array of conditions
let whereOptions: FindOptionsWhere<User> | FindOptionsWhere<User>[] = findOptions;
if (options?.searchText) {
const searchLower = options.searchText.toLowerCase();
whereConditions.concat([
{ email: ILike(`%${searchLower}%`) },
{ firstName: ILike(`%${searchLower}%`) },
{ lastName: ILike(`%${searchLower}%`) },
]);
// Create an array of OR conditions
whereOptions = [
{ ...findOptions, email: ILike(`%${searchLower}%`) },
{ ...findOptions, firstName: ILike(`%${searchLower}%`) },
{ ...findOptions, lastName: ILike(`%${searchLower}%`) },
];
}
const [items, total] = await this.manager.findAndCount(User, {
@ -74,7 +79,7 @@ export class UserRepository extends Repository<User> {
organization: true,
},
},
where: whereConditions ? whereConditions.map((condition) => ({ ...findOptions, ...condition })) : findOptions,
where: whereOptions,
order: { createdAt: 'ASC' },
take: 10,
skip: 10 * (options?.page ? options?.page - 1 : 0),