feat: remove OTP gate from transactions, fix categories auth, add implementation plan
- Remove OtpGateGuard from transactions controller (OTP verified at login) - Fix categories controller to use authenticated user instead of TEMP_USER_ID - Add comprehensive implementation plan document - Update .env.example with WEB_APP_URL - Prepare for admin dashboard development
This commit is contained in:
45
apps/api/dist/wallets/wallets.controller.js
vendored
45
apps/api/dist/wallets/wallets.controller.js
vendored
@@ -16,6 +16,7 @@ exports.WalletsController = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const wallets_service_1 = require("./wallets.service");
|
||||
const transactions_service_1 = require("../transactions/transactions.service");
|
||||
const auth_guard_1 = require("../auth/auth.guard");
|
||||
let WalletsController = class WalletsController {
|
||||
wallets;
|
||||
transactions;
|
||||
@@ -23,62 +24,68 @@ let WalletsController = class WalletsController {
|
||||
this.wallets = wallets;
|
||||
this.transactions = transactions;
|
||||
}
|
||||
list() {
|
||||
return this.wallets.list();
|
||||
list(req) {
|
||||
return this.wallets.list(req.user.userId);
|
||||
}
|
||||
async getAllTransactions() {
|
||||
return this.transactions.listAll();
|
||||
async getAllTransactions(req) {
|
||||
return this.transactions.listAll(req.user.userId);
|
||||
}
|
||||
create(body) {
|
||||
create(req, body) {
|
||||
if (!body?.name) {
|
||||
return { error: 'name is required' };
|
||||
}
|
||||
return this.wallets.create(body);
|
||||
return this.wallets.create(req.user.userId, body);
|
||||
}
|
||||
update(id, body) {
|
||||
return this.wallets.update(id, body);
|
||||
update(req, id, body) {
|
||||
return this.wallets.update(req.user.userId, id, body);
|
||||
}
|
||||
delete(id) {
|
||||
return this.wallets.delete(id);
|
||||
delete(req, id) {
|
||||
return this.wallets.delete(req.user.userId, id);
|
||||
}
|
||||
};
|
||||
exports.WalletsController = WalletsController;
|
||||
__decorate([
|
||||
(0, common_1.Get)(),
|
||||
__param(0, (0, common_1.Req)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", []),
|
||||
__metadata("design:paramtypes", [Object]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], WalletsController.prototype, "list", null);
|
||||
__decorate([
|
||||
(0, common_1.Get)('transactions'),
|
||||
__param(0, (0, common_1.Req)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", []),
|
||||
__metadata("design:paramtypes", [Object]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], WalletsController.prototype, "getAllTransactions", null);
|
||||
__decorate([
|
||||
(0, common_1.Post)(),
|
||||
__param(0, (0, common_1.Body)()),
|
||||
__param(0, (0, common_1.Req)()),
|
||||
__param(1, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object]),
|
||||
__metadata("design:paramtypes", [Object, Object]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], WalletsController.prototype, "create", null);
|
||||
__decorate([
|
||||
(0, common_1.Put)(':id'),
|
||||
__param(0, (0, common_1.Param)('id')),
|
||||
__param(1, (0, common_1.Body)()),
|
||||
__param(0, (0, common_1.Req)()),
|
||||
__param(1, (0, common_1.Param)('id')),
|
||||
__param(2, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [String, Object]),
|
||||
__metadata("design:paramtypes", [Object, String, Object]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], WalletsController.prototype, "update", null);
|
||||
__decorate([
|
||||
(0, common_1.Delete)(':id'),
|
||||
__param(0, (0, common_1.Param)('id')),
|
||||
__param(0, (0, common_1.Req)()),
|
||||
__param(1, (0, common_1.Param)('id')),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [String]),
|
||||
__metadata("design:paramtypes", [Object, String]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], WalletsController.prototype, "delete", null);
|
||||
exports.WalletsController = WalletsController = __decorate([
|
||||
(0, common_1.Controller)('wallets'),
|
||||
(0, common_1.UseGuards)(auth_guard_1.AuthGuard),
|
||||
__metadata("design:paramtypes", [wallets_service_1.WalletsService,
|
||||
transactions_service_1.TransactionsService])
|
||||
], WalletsController);
|
||||
|
||||
Reference in New Issue
Block a user