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

teableio / teable / 8536869866

03 Apr 2024 10:05AM UTC coverage: 21.234% (-0.3%) from 21.535%
8536869866

Pull #514

github

web-flow
Merge 91a25d710 into 45ee7ebb3
Pull Request #514: refactor: user and link selector

1394 of 2532 branches covered (55.06%)

27 of 1620 new or added lines in 60 files covered. (1.67%)

4 existing lines in 2 files now uncovered.

14588 of 68702 relevant lines covered (21.23%)

2.02 hits per line

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

0.0
/packages/openapi/src/share/view-link-records.ts
1
import { axios } from '../axios';
×
NEW
2
import { getRecordsRoSchema } from '../record';
×
3
import { registerRoute, urlBuilder } from '../utils';
×
4
import { z } from '../zod';
×
5

×
6
export const SHARE_VIEW_LINK_RECORDS = '/share/{shareId}/view/link-records';
×
7

×
8
export const shareViewLinkRecordsRoSchema = getRecordsRoSchema
×
NEW
9
  .pick({
×
NEW
10
    take: true,
×
NEW
11
    skip: true,
×
12
  })
×
13
  .extend({
×
NEW
14
    fieldId: z.string(),
×
NEW
15
    search: z.string().optional(),
×
16
  });
×
17

×
18
export type IShareViewLinkRecordsRo = z.infer<typeof shareViewLinkRecordsRoSchema>;
×
19

×
NEW
20
export const shareViewLinkRecordsVoSchema = z.array(
×
NEW
21
  z.object({
×
NEW
22
    id: z.string(),
×
NEW
23
    title: z.string().optional(),
×
NEW
24
  })
×
NEW
25
);
×
26

×
27
export type IShareViewLinkRecordsVo = z.infer<typeof shareViewLinkRecordsVoSchema>;
×
28

×
NEW
29
export const ShareViewLinkRecordsRoute = registerRoute({
×
30
  method: 'get',
×
31
  path: SHARE_VIEW_LINK_RECORDS,
×
NEW
32
  description:
×
NEW
33
    'In a view with a field selector, link the records list of the associated field selector to get the. Linking the desired ones inside the share view should fetch the ones that have already been selected.',
×
34
  request: {
×
35
    params: z.object({
×
36
      shareId: z.string(),
×
37
    }),
×
38
    query: shareViewLinkRecordsRoSchema,
×
39
  },
×
40
  responses: {
×
41
    200: {
×
NEW
42
      description: 'Link records list',
×
43
      content: {
×
44
        'application/json': {
×
45
          schema: shareViewLinkRecordsVoSchema,
×
46
        },
×
47
      },
×
48
    },
×
49
  },
×
50
  tags: ['share'],
×
51
});
×
52

×
53
export const getShareViewLinkRecords = async (shareId: string, query: IShareViewLinkRecordsRo) => {
×
54
  return axios.get<IShareViewLinkRecordsVo>(urlBuilder(SHARE_VIEW_LINK_RECORDS, { shareId }), {
×
55
    params: query,
×
56
  });
×
57
};
×
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