Skip to content

Commit

Permalink
feat: Move some endpoints payload to shared-types
Browse files Browse the repository at this point in the history
  • Loading branch information
letehaha committed Jul 7, 2023
1 parent 4dbae6a commit eb02806
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions shared-types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ export enum CATEGORY_TYPES {

export * from './api';
export * from './models';
export * as endpointsPayloadTypes from './routes';
1 change: 1 addition & 0 deletions shared-types/routes/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './monobank';
5 changes: 5 additions & 0 deletions shared-types/routes/monobank.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface UpdateMonobankTransactionBody {
id: number;
categoryId?: number;
note?: string;
}
7 changes: 2 additions & 5 deletions src/controllers/banks/monobank.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
PAYMENT_TYPES,
MonobankAccountModel,
MonobankUserModel,
endpointsPayloadTypes,
} from 'shared-types';
import {
CustomResponse,
Expand Down Expand Up @@ -359,11 +360,7 @@ export const updateTransaction = async (req, res: CustomResponse) => {
id,
categoryId,
note,
}: {
id: number;
categoryId?: number;
note?: string;
} = req.body;
}: endpointsPayloadTypes.UpdateMonobankTransactionBody = req.body;

try {
const transaction = await monobankTransactionsService.updateTransactionById({
Expand Down

0 comments on commit eb02806

Please sign in to comment.