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

teableio / teable / 8356130399

20 Mar 2024 08:52AM UTC coverage: 28.231% (+0.06%) from 28.17%
8356130399

push

github

web-flow
refactor: row order (#473)

* refactor: row order

* fix: sqlite test

2122 of 3238 branches covered (65.53%)

194 of 588 new or added lines in 38 files covered. (32.99%)

2 existing lines in 2 files now uncovered.

25811 of 91428 relevant lines covered (28.23%)

5.58 hits per line

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

22.5
/packages/sdk/src/model/record/record.ts
1
/* eslint-disable @typescript-eslint/naming-convention */
1✔
2
import type { IRecord } from '@teable/core';
1✔
3
import { RecordOpBuilder, RecordCore } from '@teable/core';
1✔
4
import { createRecords, getRecords, updateRecordOrders } from '@teable/openapi';
1✔
5
import type { Doc } from 'sharedb/lib/client';
1✔
6
import { requestWrap } from '../../utils/requestWrap';
1✔
7
import type { IFieldInstance } from '../field/factory';
1✔
8

1✔
9
export class Record extends RecordCore {
1!
10
  static createRecords = requestWrap(createRecords);
×
11

×
12
  static getRecords = requestWrap(getRecords);
×
13

×
NEW
14
  static updateRecordOrders = requestWrap(updateRecordOrders);
✔
NEW
15

×
16
  constructor(
×
17
    protected doc: Doc<IRecord>,
×
18
    protected fieldMap: { [fieldId: string]: IFieldInstance }
×
19
  ) {
×
20
    super(fieldMap);
×
21
  }
×
22

×
23
  async updateCell(fieldId: string, cellValue: unknown) {
×
24
    const operation = RecordOpBuilder.editor.setRecord.build({
×
25
      fieldId,
×
26
      newCellValue: cellValue,
×
27
      oldCellValue: this.fields[fieldId],
×
28
    });
×
29

×
30
    try {
×
31
      return await new Promise((resolve, reject) => {
×
32
        this.doc.submitOp([operation], undefined, (error) => {
×
33
          error ? reject(error) : resolve(undefined);
×
34
        });
×
35
      });
×
36
    } catch (error) {
×
37
      return error;
×
38
    }
×
39
  }
×
40
}
×
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