@@ -18,12 +18,12 @@ import {
18
18
} from '@loopback/rest' ;
19
19
import { Todo } from '../models' ;
20
20
import { TodoRepository } from '../repositories' ;
21
- import { GeocoderService } from '../services' ;
21
+ import { Geocoder } from '../services' ;
22
22
23
23
export class TodoController {
24
24
constructor (
25
- @repository ( TodoRepository ) protected todoRepo : TodoRepository ,
26
- @inject ( 'services.GeocoderService ' ) protected geoService : GeocoderService ,
25
+ @repository ( TodoRepository ) protected todoRepository : TodoRepository ,
26
+ @inject ( 'services.Geocoder ' ) protected geoService : Geocoder ,
27
27
) { }
28
28
29
29
@post ( '/todos' , {
@@ -52,7 +52,7 @@ export class TodoController {
52
52
// https://gis.stackexchange.com/q/7379
53
53
todo . remindAtGeo = `${ geo [ 0 ] . y } ,${ geo [ 0 ] . x } ` ;
54
54
}
55
- return this . todoRepo . create ( todo ) ;
55
+ return this . todoRepository . create ( todo ) ;
56
56
}
57
57
58
58
@get ( '/todos/{id}' , {
@@ -67,7 +67,7 @@ export class TodoController {
67
67
@param . path . number ( 'id' ) id : number ,
68
68
@param . query . boolean ( 'items' ) items ?: boolean ,
69
69
) : Promise < Todo > {
70
- return this . todoRepo . findById ( id ) ;
70
+ return this . todoRepository . findById ( id ) ;
71
71
}
72
72
73
73
@get ( '/todos' , {
@@ -86,7 +86,7 @@ export class TodoController {
86
86
@param . query . object ( 'filter' , getFilterSchemaFor ( Todo ) )
87
87
filter ?: Filter < Todo > ,
88
88
) : Promise < Todo [ ] > {
89
- return this . todoRepo . find ( filter ) ;
89
+ return this . todoRepository . find ( filter ) ;
90
90
}
91
91
92
92
@put ( '/todos/{id}' , {
@@ -100,7 +100,7 @@ export class TodoController {
100
100
@param . path . number ( 'id' ) id : number ,
101
101
@requestBody ( ) todo : Todo ,
102
102
) : Promise < void > {
103
- await this . todoRepo . replaceById ( id , todo ) ;
103
+ await this . todoRepository . replaceById ( id , todo ) ;
104
104
}
105
105
106
106
@patch ( '/todos/{id}' , {
@@ -121,7 +121,7 @@ export class TodoController {
121
121
} )
122
122
todo : Partial < Todo > ,
123
123
) : Promise < void > {
124
- await this . todoRepo . updateById ( id , todo ) ;
124
+ await this . todoRepository . updateById ( id , todo ) ;
125
125
}
126
126
127
127
@del ( '/todos/{id}' , {
@@ -132,6 +132,6 @@ export class TodoController {
132
132
} ,
133
133
} )
134
134
async deleteTodo ( @param . path . number ( 'id' ) id : number ) : Promise < void > {
135
- await this . todoRepo . deleteById ( id ) ;
135
+ await this . todoRepository . deleteById ( id ) ;
136
136
}
137
137
}
0 commit comments