mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
fix: handle expense already published error.
fix: expense validation schema.
This commit is contained in:
@@ -20,7 +20,7 @@ const ERRORS = {
|
||||
TOTAL_AMOUNT_EQUALS_ZERO: 'total_amount_equals_zero',
|
||||
PAYMENT_ACCOUNT_HAS_INVALID_TYPE: 'payment_account_has_invalid_type',
|
||||
EXPENSES_ACCOUNT_HAS_INVALID_TYPE: 'expenses_account_has_invalid_type',
|
||||
EXPENSE_ACCOUNT_ALREADY_PUBLISED: 'expense_already_published',
|
||||
EXPENSE_ALREADY_PUBLISHED: 'expense_already_published',
|
||||
};
|
||||
|
||||
@Service()
|
||||
@@ -219,7 +219,7 @@ export default class ExpensesService implements IExpensesService {
|
||||
*/
|
||||
private validateExpenseIsNotPublished(expense: IExpense) {
|
||||
if (expense.publishedAt) {
|
||||
throw new ServiceError(ERRORS.EXPENSE_ACCOUNT_ALREADY_PUBLISED);
|
||||
throw new ServiceError(ERRORS.EXPENSE_ALREADY_PUBLISHED);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user