Browse Source

chore: lint

pull/8592/head
Pranav C 6 months ago
parent
commit
878da92b2c
  1. 1
      packages/nocodb/src/controllers/comments.controller.ts
  2. 1
      packages/nocodb/src/meta/migrations/v2/nc_046_comment_mentions.ts
  3. 6
      packages/nocodb/src/meta/migrations/v2/nc_047_comment_migration.ts
  4. 3
      packages/nocodb/src/utils/richTextHelper.ts

1
packages/nocodb/src/controllers/comments.controller.ts

@ -11,7 +11,6 @@ import {
Req, Req,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { Request } from 'express';
import { GlobalGuard } from '~/guards/global/global.guard'; import { GlobalGuard } from '~/guards/global/global.guard';
import { PagedResponseImpl } from '~/helpers/PagedResponse'; import { PagedResponseImpl } from '~/helpers/PagedResponse';
import { CommentsService } from '~/services/comments.service'; import { CommentsService } from '~/services/comments.service';

1
packages/nocodb/src/meta/migrations/v2/nc_046_comment_mentions.ts

@ -1,4 +1,3 @@
import { Logger } from '@nestjs/common';
import type { Knex } from 'knex'; import type { Knex } from 'knex';
import { MetaTable } from '~/utils/globals'; import { MetaTable } from '~/utils/globals';

6
packages/nocodb/src/meta/migrations/v2/nc_047_comment_migration.ts

@ -38,7 +38,7 @@ const up = async (knex: Knex) => {
.limit(READ_BATCH_SIZE + 1); .limit(READ_BATCH_SIZE + 1);
logger.log( logger.log(
`Data from Audit Table fetched, batch: ${offset} - ${ `Data from Audit Table fetched, batch: ${offset} - ${
offset + READ_BATCH_SIZE offset + READ_BATCH_SIZE
}`, }`,
); );
@ -72,9 +72,7 @@ const up = async (knex: Knex) => {
// check if there are more rows to fetch // check if there are more rows to fetch
fetchNextBatch = rows.length > READ_BATCH_SIZE; fetchNextBatch = rows.length > READ_BATCH_SIZE;
} }
logger.log( logger.log('Data migrated from Audit Table to Comments Table');
'Data migrated from Audit Table to Comments Table',
);
}; };
const down = async (knex: Knex) => { const down = async (knex: Knex) => {

3
packages/nocodb/src/utils/richTextHelper.ts

@ -6,8 +6,7 @@ export const extractMentions = (richText: string) => {
const regex = /@\(([^)]+)\)/g; const regex = /@\(([^)]+)\)/g;
let match: RegExpExecArray | null; const match: RegExpExecArray | null = regex.exec(richText);
match = regex.exec(richText);
while (match !== null) { while (match !== null) {
const userId = match[1].split('|')[0]; // Extracts the userId part from the matched string const userId = match[1].split('|')[0]; // Extracts the userId part from the matched string
mentions.push(userId); mentions.push(userId);

Loading…
Cancel
Save