mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
init (#12530)
This commit is contained in:
parent
9ba29c5144
commit
3ac43a6bc9
4 changed files with 22 additions and 16 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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 || []) {
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ export default class LicenseBase {
|
|||
}
|
||||
|
||||
public get ai(): object {
|
||||
return this._ai;
|
||||
return this._ai || {};
|
||||
}
|
||||
|
||||
public get aiFeature(): boolean {
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in a new issue