• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

teableio / teable / 20065394908

09 Dec 2025 01:36PM UTC coverage: 71.858%. First build
20065394908

Pull #2168

github

web-flow
Merge b9dc7a0f8 into 6fd609a47
Pull Request #2168: feat: base node

22892 of 25545 branches covered (89.61%)

1916 of 2478 new or added lines in 35 files covered. (77.32%)

57741 of 80354 relevant lines covered (71.86%)

4259.47 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

59.09
/apps/nestjs-backend/src/features/table/open-api/table.pipe.helper.ts
1
import type { IFieldVo } from '@teable/core';
8✔
2
import { HttpErrorCode, PRIMARY_SUPPORTED_TYPES } from '@teable/core';
3
import type { ICreateTableRo, ICreateTableWithDefault } from '@teable/openapi';
4
import { CustomHttpException } from '../../../custom.exception';
5
import { DEFAULT_FIELDS, DEFAULT_VIEWS, DEFAULT_RECORD_DATA } from '../constant';
6

7
export const prepareCreateTableRo = (tableRo: ICreateTableRo): ICreateTableWithDefault => {
8✔
8
  const fieldRos = tableRo.fields && tableRo.fields.length ? tableRo.fields : DEFAULT_FIELDS;
2,408✔
9
  // make sure first field to be the primary field;
2,408✔
10
  (fieldRos[0] as IFieldVo).isPrimary = true;
2,408✔
11
  if (!PRIMARY_SUPPORTED_TYPES.has(fieldRos[0].type)) {
2,408!
NEW
12
    throw new CustomHttpException(
×
NEW
13
      `Field type ${fieldRos[0].type} is not supported as primary field`,
×
NEW
14
      HttpErrorCode.VALIDATION_ERROR,
×
NEW
15
      {
×
NEW
16
        localization: {
×
NEW
17
          i18nKey: 'httpErrors.field.primaryFieldNotSupported',
×
NEW
18
        },
×
NEW
19
      }
×
20
    );
NEW
21
  }
×
22

23
  return {
2,408✔
24
    ...tableRo,
2,408✔
25
    fields: fieldRos,
2,408✔
26
    views: tableRo.views && tableRo.views.length ? tableRo.views : DEFAULT_VIEWS,
2,408✔
27
    records: tableRo.records ? tableRo.records : DEFAULT_RECORD_DATA,
2,408✔
28
  };
2,408✔
29
};
2,408✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc