updateOne method
Future<QuickbooksInvoice>
updateOne({
- required String accessToken,
- required String companyId,
- required QuickbooksInvoice data,
Updates a QuickbooksInvoice with
the given accessToken
and companyId
Implementation
Future<QuickbooksInvoice> updateOne({
required String accessToken,
required String companyId,
required QuickbooksInvoice data,
}) async {
var oldData = await get(
accessToken: accessToken,
companyId: companyId,
id: data.id!,
);
if (oldData == null) {
throw AlfredException(404, 'Data not found');
}
data.syncToken = oldData.syncToken;
var result = await post(
accessToken: accessToken,
companyId: companyId,
data: data.toMap(),
location: 'Invoice',
);
var newData = QuickbooksInvoice.fromMap(result);
return newData;
}