11import type { Client , Request } from '~/interfaces' ;
22import { boardSchema , Board , CreateBoard } from '~/schemas/api/boards' ;
3- import { TrelloId } from '~/schemas/common' ;
3+ import { customFieldsSchema , TrelloId } from '~/schemas/common' ;
44import { Members } from './members' ;
55
66export class Boards {
@@ -21,18 +21,10 @@ export class Boards {
2121 return this . client . sendRequest < T , never > ( request , boardSchema ) ;
2222 }
2323
24- // async list() {
25- // const request: Request = {
26- // url: '/members/me/'
27- // };
28- //
29- // return this.client.sendRequest(request);
30- // }
31-
3224 async getAll ( ) {
3325 const boardsId = await this . membersClient . getBoards ( 'me' ) ;
3426
35- const boards : Board [ ] = [ ] ;
27+ const boards : Board [ ] = [ ] ;
3628
3729 for ( const { id } of boardsId ) {
3830 const board = await this . get ( id ) ;
@@ -54,5 +46,22 @@ export class Boards {
5446 return this . client . sendRequest ( request , boardSchema ) ;
5547 }
5648
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+ }
5867}
0 commit comments