fixing conflict
This commit is contained in:
@@ -1,17 +1,19 @@
|
||||
// notification_api.dart
|
||||
class NotificationApi {
|
||||
static const String notifications = '/api/v1/notifications';
|
||||
static String getNotifications({required int limit, required int offset}) {
|
||||
return '$notifications?limit=$limit&offset=$offset';
|
||||
}
|
||||
static const String feedback = '/api/v1/feedback';
|
||||
|
||||
|
||||
|
||||
static const String markAllAsRead = '/api/v1/notifications/mark';
|
||||
static const String markAsRead = '/api/v1/notifications/mark-as-read';
|
||||
static const String tenderApprovalsTender = '/api/v1/notifications';
|
||||
|
||||
static const String unreadNotifications = '/api/v1/notifications?seen=false';
|
||||
static String getUnreadNotifications({required int limit, required int offset}) {
|
||||
return '$unreadNotifications?limit=$limit&offset=$offset';
|
||||
static String getUnreadNotifications({required int limit, required int offset}) {
|
||||
return '/api/v1/notifications?seen=false&limit=$limit&offset=$offset';
|
||||
}
|
||||
}
|
||||
|
||||
static String getImportantNotifications({required int limit, required int offset}) {
|
||||
return '/api/v1/notifications?priority=important&limit=$limit&offset=$offset';
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,8 @@
|
||||
// notification_service.dart
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:tm_app/core/utils/result.dart';
|
||||
import 'package:tm_app/data/services/api/notification_api.dart';
|
||||
import 'package:tm_app/data/services/model/notification__response/notification_response_model.dart';
|
||||
|
||||
import '../../core/network/network_manager.dart';
|
||||
|
||||
class NotificationsService {
|
||||
@@ -18,7 +16,6 @@ class NotificationsService {
|
||||
}) async {
|
||||
final result = await _networkManager.makeRequest(
|
||||
NotificationApi.getNotifications(limit: limit, offset: offset),
|
||||
//NotificationApi.notifications,
|
||||
method: 'GET',
|
||||
(json) => NotificationResponseModel.fromJson(json),
|
||||
);
|
||||
@@ -52,7 +49,19 @@ class NotificationsService {
|
||||
required int offset,
|
||||
}) async {
|
||||
final result = await _networkManager.makeRequest(
|
||||
NotificationApi.unreadNotifications,
|
||||
NotificationApi.getUnreadNotifications(limit: limit, offset: offset),
|
||||
method: 'GET',
|
||||
(json) => NotificationResponseModel.fromJson(json),
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
Future<Result<NotificationResponseModel>> getImportantNotifications({
|
||||
required int limit,
|
||||
required int offset,
|
||||
}) async {
|
||||
final result = await _networkManager.makeRequest(
|
||||
NotificationApi.getImportantNotifications(limit: limit, offset: offset),
|
||||
method: 'GET',
|
||||
(json) => NotificationResponseModel.fromJson(json),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user