deleteClient method
Future<Response>
deleteClient(
{ - dynamic accessToken,
- dynamic clientId,
})
Implementation
Future<Response> deleteClient(
{accessToken, clientId}) async {
Client client = Client(
clientId: clientId,
);
String body = jsonEncode(client);
String api = 'delete_client';
Map<String, String> headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer $accessToken'
};
var response =
await networking.deleteData(api: api, body: body, headers: headers);
if (response.isSuccess) {
return Response(true, message: '', data: response.data);
} else if (response.message.contains('No records')) {
return Response(false, message: 'No records');
}
return Response(false, message: response.message);
}