Skip to content
This repository has been archived by the owner on Jul 6, 2024. It is now read-only.

Commit

Permalink
Update routes (#30)
Browse files Browse the repository at this point in the history
* Update routes

* Update pubspec.yaml

* Fix test
  • Loading branch information
Udito3 authored Apr 12, 2024
1 parent d45abc6 commit d1a753b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions lib/src/hello_api_client_implementation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ class HelloAPIClient implements IHelloAPIClient {
/// [organizerId] The organizer id
@override
Future<Organizer?> getOrganizer(String organizerId) async {
final uri =
Uri.https(Urls.helloNewsAPI, '/api/moderator/organizer/$organizerId');
final uri = Uri.https(Urls.helloNewsAPI, '/api/organizers/$organizerId');
final response = await _httpClient.get(uri);

// Log the http error and throw a exception
Expand All @@ -110,7 +109,7 @@ class HelloAPIClient implements IHelloAPIClient {
/// [report] The report
@override
Future<bool> reportNews(String newsId, Report report) async {
final uri = Uri.https(Urls.helloNewsAPI, '/api/events/$newsId/reports');
final uri = Uri.https(Urls.helloNewsAPI, '/api/reports/$newsId');
final response = await _httpClient.post(
uri,
headers: <String, String>{
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: ets_api_clients

description: API clients to help process calls from any application that need to access
version: 1.2.2
version: 1.2.3

homepage: https://clubapplets.ca/
repository: https://github.com/ApplETS/ETS-API-Clients
Expand Down
5 changes: 2 additions & 3 deletions test/hello_api_client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ void main() {

final apiResponse = ApiResponse<Organizer>(data: organizer);

final uri =
Uri.https(Urls.helloNewsAPI, '/api/moderator/organizer/$organizerId');
final uri = Uri.https(Urls.helloNewsAPI, '/api/organizers/$organizerId');
mockClient = HttpClientMockHelper.stubJsonGet(uri.toString(),
apiResponse.toJson((organizer) => organizer.toJson()));
service = buildService(mockClient);
Expand Down Expand Up @@ -171,7 +170,7 @@ void main() {
group('reportNews - ', () {
test('successful report', () async {
const newsId = '123';
final uri = Uri.https(Urls.helloNewsAPI, '/api/events/$newsId/reports');
final uri = Uri.https(Urls.helloNewsAPI, '/api/reports/$newsId');
mockClient = HttpClientMockHelper.stubJsonPost(uri.toString(), {}, 200);
service = buildService(mockClient);

Expand Down

0 comments on commit d1a753b

Please sign in to comment.