updateOne method
Future<QuickbooksAccount>
updateOne({
- required String accessToken,
- required String companyId,
- required QuickbooksAccount data,
Updates a QuickbooksAccount with
the given accessToken
and companyId
Implementation
Future<QuickbooksAccount> updateOne({
required String accessToken,
required String companyId,
required QuickbooksAccount 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: 'Account',
);
var newData = QuickbooksAccount.fromMap(result);
return newData;
}