Skip to content

Commit 7de4f4c

Browse files
authored
Merge pull request #103 from atlp-rwanda/fixing-order-bug
[Finishes bug] Fixing order bug
2 parents e9e74f8 + f701675 commit 7de4f4c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: src/controllers/orderController.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export const getUserOrders = async (req: Request, res: Response) => {
127127
return sendInternalErrorResponse(res, err);
128128
}
129129
};
130+
130131
export const sellerProductOrders = async (req: Request, res: Response) => {
131132
try {
132133
const { id } = req.user as User;
@@ -143,8 +144,14 @@ export const sellerProductOrders = async (req: Request, res: Response) => {
143144
},
144145
],
145146
},
147+
{
148+
model: User,
149+
as: 'user',
150+
attributes: ['id', 'firstName', 'lastName'],
151+
},
146152
],
147153
});
154+
148155
if (!orders) {
149156
return sendErrorResponse(res, 'No orders found');
150157
}
@@ -159,7 +166,6 @@ export const sellerProductOrders = async (req: Request, res: Response) => {
159166
return sendInternalErrorResponse(res, err);
160167
}
161168
};
162-
163169
export const deleteOrder = async (req: Request, res: Response) => {
164170
try {
165171
const order = await Order.findByPk(req.params.id);

0 commit comments

Comments
 (0)