File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,6 +46,11 @@ export const createComplex = async (data: ComplexInput): Promise<Complex> => {
4646 return response . json ( ) ;
4747} ;
4848
49+ export const fetchComplex = async ( id : string ) : Promise < Complex > => {
50+ const response = await fetch ( `${ API_BASE_URL } /complexes/${ id } ` ) ;
51+ return response . json ( ) ;
52+ } ;
53+
4954/* Delete complex */
5055export const deleteComplex = async ( id : number ) : Promise < void > => {
5156 const response = await fetch ( `${ API_BASE_URL } /complexes/${ id } ` , {
Original file line number Diff line number Diff line change @@ -11,3 +11,21 @@ export interface ComplexInput {
1111 content : string ;
1212 category : string ;
1313}
14+
15+ export interface Goal {
16+ id : number ;
17+ complex_id : number ;
18+ surface_goal : string ;
19+ underlying_goal : string ;
20+ created_at : string ;
21+ updated_at : string ;
22+ }
23+
24+ export interface ActionInput {
25+ content : string ;
26+ completed_at ?: string ;
27+ category : string ;
28+ created_at : string ;
29+ updated_at : string ;
30+ goals ?: Goal [ ] ;
31+ }
You can’t perform that action at this time.
0 commit comments