@@ -9,16 +9,16 @@ export default class TestCaseService {
9
9
}
10
10
11
11
async findAll ( ) {
12
- var res = await axios . get ( `${ this . apiEndpoint } /v1/test-cases` , useAuthHeaders ( ) )
12
+ const res = await axios . get ( `${ this . apiEndpoint } /v1/test-cases` , useAuthHeaders ( ) )
13
13
if ( res . status == 200 ) {
14
14
return res . data . test_cases || [ ] ;
15
15
}
16
16
throw new Error ( res . data ) ;
17
17
}
18
18
19
19
20
- async findById ( id : String ) {
21
- var res = await axios . get ( `${ this . apiEndpoint } /v1/test-cases/${ id } ` , useAuthHeaders ( ) )
20
+ async findById ( id : string ) {
21
+ const res = await axios . get ( `${ this . apiEndpoint } /v1/test-cases/${ id } ` , useAuthHeaders ( ) )
22
22
if ( res . status === 200 ) {
23
23
return res . data . test_case ;
24
24
}
@@ -27,15 +27,15 @@ export default class TestCaseService {
27
27
28
28
29
29
async findByProjectId ( projectID : number ) {
30
- var res = await axios . get ( `${ this . apiEndpoint } /v1/projects/${ projectID } /test-cases` , useAuthHeaders ( ) )
30
+ const res = await axios . get ( `${ this . apiEndpoint } /v1/projects/${ projectID } /test-cases` , useAuthHeaders ( ) )
31
31
if ( res . status === 200 ) {
32
32
return res . data . test_cases || [ ] ;
33
33
}
34
34
throw new Error ( res . data ) ;
35
35
}
36
36
37
37
async create ( data : any ) {
38
- var res = await axios . post ( `${ this . apiEndpoint } /v1/test-cases` , data , useAuthHeaders ( ) )
38
+ const res = await axios . post ( `${ this . apiEndpoint } /v1/test-cases` , data , useAuthHeaders ( ) )
39
39
if ( res . status === 200 ) {
40
40
// TODO: return a specific shape of the response, not the whole response
41
41
// return res.data.test_case;
0 commit comments