1
1
import type { Client , Request } from '~/interfaces' ;
2
2
import { boardSchema , Board , CreateBoard } from '~/schemas/api/boards' ;
3
- import { TrelloId } from '~/schemas/common' ;
3
+ import { customFieldsSchema , TrelloId } from '~/schemas/common' ;
4
4
import { Members } from './members' ;
5
5
6
6
export class Boards {
@@ -21,18 +21,10 @@ export class Boards {
21
21
return this . client . sendRequest < T , never > ( request , boardSchema ) ;
22
22
}
23
23
24
- // async list() {
25
- // const request: Request = {
26
- // url: '/members/me/'
27
- // };
28
- //
29
- // return this.client.sendRequest(request);
30
- // }
31
-
32
24
async getAll ( ) {
33
25
const boardsId = await this . membersClient . getBoards ( 'me' ) ;
34
26
35
- const boards : Board [ ] = [ ] ;
27
+ const boards : Board [ ] = [ ] ;
36
28
37
29
for ( const { id } of boardsId ) {
38
30
const board = await this . get ( id ) ;
@@ -54,5 +46,22 @@ export class Boards {
54
46
return this . client . sendRequest ( request , boardSchema ) ;
55
47
}
56
48
57
- // async delete(boardId) {}
49
+ async delete ( boardId : TrelloId ) {
50
+ const request : Request = {
51
+ url : `/boards/${ boardId } ` ,
52
+ method : 'DELETE' ,
53
+ } ;
54
+
55
+ return this . client . sendRequest ( request ) ;
56
+ }
57
+
58
+ /** Get the Custom Field Definitions that exist on a board. */
59
+ async getCustomFields ( boardId : TrelloId ) {
60
+ const request : Request = {
61
+ url : `/boards/${ boardId } /customFields` ,
62
+ method : 'GET' ,
63
+ }
64
+
65
+ return this . client . sendRequest ( request , customFieldsSchema ) ;
66
+ }
58
67
}
0 commit comments