Skip to content

Commit a2a1a04

Browse files
committed
Update types
1 parent 934e060 commit a2a1a04

File tree

4 files changed

+13
-18
lines changed

4 files changed

+13
-18
lines changed

site/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"react-dom": "17.0.2",
3939
"react-router-dom": "6.3.0",
4040
"swr": "1.2.2",
41+
"uuid": "^8.3.2",
4142
"xstate": "4.30.6",
4243
"yup": "0.32.11"
4344
},
@@ -57,6 +58,7 @@
5758
"@types/react": "17.0.43",
5859
"@types/react-dom": "17.0.14",
5960
"@types/superagent": "4.1.15",
61+
"@types/uuid": "^8.3.4",
6062
"@typescript-eslint/eslint-plugin": "5.18.0",
6163
"@typescript-eslint/parser": "5.18.0",
6264
"@xstate/cli": "0.1.6",

site/src/api/types.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import internal from "stream";
2-
31
/**
42
* `BuildInfoResponse` must be kept in sync with the go struct in buildinfo.go.
53
*/
@@ -77,18 +75,12 @@ export interface UserAgent {
7775
readonly os: string
7876
}
7977

80-
export interface Cursor {
78+
export interface Pager {
8179
after: string
8280
before: string
8381
limit: number
8482
total: number
8583
}
86-
export interface Pager {
87-
cursor: Cursor
88-
next: string
89-
previous: string
90-
total: number
91-
}
9284

9385
export interface PagedUsers {
9486
page: UserResponse[]

site/src/test_helpers/entities.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
Workspace,
99
Pager
1010
} from "../api/types"
11+
import { v4 as uuidv4 } from 'uuid';
1112

1213
export const MockSessionToken = { session_token: "my-session-token" }
1314

@@ -33,15 +34,10 @@ export const MockUser2: UserResponse = {
3334
}
3435

3536
export const MockPager: Pager = {
36-
cursor: {
37-
after: "",
38-
before: "",
39-
limit: 10,
40-
total: 25
41-
},
42-
next: "",
43-
previous: "",
44-
total: 25
37+
after: uuidv4(),
38+
before: uuidv4(),
39+
limit: 10,
40+
total: 25
4541
}
4642

4743
export const MockOrganization: Organization = {

site/yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3751,6 +3751,11 @@
37513751
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d"
37523752
integrity sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==
37533753

3754+
"@types/uuid@^8.3.4":
3755+
version "8.3.4"
3756+
resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.4.tgz#bd86a43617df0594787d38b735f55c805becf1bc"
3757+
integrity sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==
3758+
37543759
"@types/webpack-env@^1.16.0":
37553760
version "1.16.3"
37563761
resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.16.3.tgz#b776327a73e561b71e7881d0cd6d34a1424db86a"

0 commit comments

Comments
 (0)