add discount api
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:fcs/domain/entities/discount.dart';
|
||||
import 'package:fcs/domain/entities/payment_method.dart';
|
||||
import 'package:fcs/domain/vo/message.dart';
|
||||
import 'package:fcs/helpers/api_helper.dart';
|
||||
@@ -32,4 +33,19 @@ class CommonDataProvider {
|
||||
payload: {"owner_id": ownerID, "seen_by_owner": seenByOwner},
|
||||
token: await getToken());
|
||||
}
|
||||
|
||||
Future<void> createDiscount(Discount discount) async {
|
||||
return await requestAPI("/discounts", "POST",
|
||||
payload: discount.toMap(), token: await getToken());
|
||||
}
|
||||
|
||||
Future<void> updateDiscount(Discount discount) async {
|
||||
return await requestAPI("/discounts", "PUT",
|
||||
payload: discount.toMap(), token: await getToken());
|
||||
}
|
||||
|
||||
Future<void> deleteDiscount(String id) async {
|
||||
return await requestAPI("/discounts", "DELETE",
|
||||
payload: {"id": id}, token: await getToken());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user