From 2c4df90d8d0db6283f3ab4248553b66c1885df85 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Fri, 5 Feb 2021 20:35:04 -0700 Subject: [PATCH] Remove budgets prefix from paths --- src/app/app-routing.module.ts | 14 +++++++------- .../budget-details/budget-details.component.html | 12 ++++++------ .../category-details.component.html | 4 ++-- .../category-list/category-list.component.html | 2 +- .../new-transaction/new-transaction.component.ts | 2 +- .../transaction-list.component.html | 2 +- .../transaction-list/transaction-list.component.ts | 6 +++--- src/app/transactions/transactions.component.html | 4 ++-- src/app/transactions/transactions.component.ts | 8 ++++---- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 6b01b50..047ef94 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -22,13 +22,13 @@ const routes: Routes = [ { path: 'budgets/new', component: NewBudgetComponent }, { path: 'budgets/:id', component: BudgetDetailsComponent }, { path: 'budgets/:id/edit', component: EditBudgetComponent }, - { path: 'budgets/:budgetId/transactions', component: TransactionsComponent }, - { path: 'budgets/:budgetId/transactions/new', component: NewTransactionComponent }, - { path: 'budgets/:budgetId/transactions/:id', component: TransactionDetailsComponent }, - { path: 'budgets/:budgetId/categories', component: CategoriesComponent }, - { path: 'budgets/:budgetId/categories/new', component: NewCategoryComponent }, - { path: 'budgets/:budgetId/categories/:id', component: CategoryDetailsComponent }, - { path: 'budgets/:budgetId/categories/:id/edit', component: EditCategoryComponent }, + { path: 'transactions', component: TransactionsComponent }, + { path: 'transactions/new', component: NewTransactionComponent }, + { path: 'transactions/:id', component: TransactionDetailsComponent }, + { path: 'categories', component: CategoriesComponent }, + { path: 'categories/new', component: NewCategoryComponent }, + { path: 'categories/:id', component: CategoryDetailsComponent }, + { path: 'categories/:id/edit', component: EditCategoryComponent }, ]; @NgModule({ diff --git a/src/app/budgets/budget-details/budget-details.component.html b/src/app/budgets/budget-details/budget-details.component.html index 1b61030..fcbd8fa 100644 --- a/src/app/budgets/budget-details/budget-details.component.html +++ b/src/app/budgets/budget-details/budget-details.component.html @@ -8,14 +8,14 @@
- View Transactions + View Transactions

Income

- Add Category + Add Category - + add \ No newline at end of file diff --git a/src/app/categories/category-details/category-details.component.html b/src/app/categories/category-details/category-details.component.html index a89dc9d..b280866 100644 --- a/src/app/categories/category-details/category-details.component.html +++ b/src/app/categories/category-details/category-details.component.html @@ -1,5 +1,5 @@

- - + + add \ No newline at end of file diff --git a/src/app/categories/category-list/category-list.component.html b/src/app/categories/category-list/category-list.component.html index b784b2e..20bb27c 100644 --- a/src/app/categories/category-list/category-list.component.html +++ b/src/app/categories/category-list/category-list.component.html @@ -1,5 +1,5 @@ - +

{{ category.title }} diff --git a/src/app/transactions/new-transaction/new-transaction.component.ts b/src/app/transactions/new-transaction/new-transaction.component.ts index 5354cc3..c6c8bb3 100644 --- a/src/app/transactions/new-transaction/new-transaction.component.ts +++ b/src/app/transactions/new-transaction/new-transaction.component.ts @@ -17,7 +17,7 @@ export class NewTransactionComponent implements OnInit { ) { } ngOnInit() { - this.budgetId = this.route.snapshot.paramMap.get('budgetId'); + this.budgetId = this.route.snapshot.queryParamMap.get('budgetId'); this.transaction = new Transaction(); } diff --git a/src/app/transactions/transaction-list/transaction-list.component.html b/src/app/transactions/transaction-list/transaction-list.component.html index 17c7bdf..bb02378 100644 --- a/src/app/transactions/transaction-list/transaction-list.component.html +++ b/src/app/transactions/transaction-list/transaction-list.component.html @@ -1,6 +1,6 @@ + routerLink="/transactions/{{ transaction.id }}">

{{transaction.title}}

diff --git a/src/app/transactions/transaction-list/transaction-list.component.ts b/src/app/transactions/transaction-list/transaction-list.component.ts index 3fd2975..82a5e8d 100644 --- a/src/app/transactions/transaction-list/transaction-list.component.ts +++ b/src/app/transactions/transaction-list/transaction-list.component.ts @@ -10,8 +10,8 @@ import { ActivatedRoute } from '@angular/router'; }) export class TransactionListComponent implements OnInit { - @Input() budgetId: string; - @Input() categoryId?: string; + @Input() budgetIds: string[]; + @Input() categoryIds?: string[]; public transactions: Transaction[]; constructor( @@ -52,7 +52,7 @@ export class TransactionListComponent implements OnInit { } } - this.twigsService.getTransactions(this.budgetId, this.categoryId, null, from, to).subscribe(transactions => { + this.twigsService.getTransactions(this.budgetIds.join(','), this.categoryIds.join(','), null, from, to).subscribe(transactions => { this.transactions = transactions; }); } diff --git a/src/app/transactions/transactions.component.html b/src/app/transactions/transactions.component.html index 3194c12..a328b51 100644 --- a/src/app/transactions/transactions.component.html +++ b/src/app/transactions/transactions.component.html @@ -1,4 +1,4 @@ - - + + add \ No newline at end of file diff --git a/src/app/transactions/transactions.component.ts b/src/app/transactions/transactions.component.ts index 4e49dca..ff9f337 100644 --- a/src/app/transactions/transactions.component.ts +++ b/src/app/transactions/transactions.component.ts @@ -9,8 +9,8 @@ import { ActivatedRoute } from '@angular/router'; }) export class TransactionsComponent implements OnInit { - budgetId: number; - categoryId?: number; + budgetId?: string; + categoryId?: string; constructor( private route: ActivatedRoute, @@ -18,8 +18,8 @@ export class TransactionsComponent implements OnInit { ) { } ngOnInit() { - this.budgetId = Number.parseInt(this.route.snapshot.paramMap.get('budgetId')); - this.categoryId = Number.parseInt(this.route.snapshot.queryParamMap.get('categoryId')); + this.budgetId = this.route.snapshot.queryParamMap.get('budgetIds'); + this.categoryId = this.route.snapshot.queryParamMap.get('categoryIds'); this.app.setBackEnabled(true); this.app.setTitle('Transactions') }