some
This commit is contained in:
@@ -5,10 +5,8 @@ import org.springframework.http.HttpStatus
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.web.bind.annotation.*
|
||||
import org.springframework.web.client.HttpClientErrorException
|
||||
import reactor.core.publisher.Flux
|
||||
import reactor.core.publisher.Mono
|
||||
import space.luminic.budgerapp.controllers.BudgetController.LimitValue
|
||||
import space.luminic.budgerapp.controllers.dtos.BudgetCreationDTO
|
||||
import space.luminic.budgerapp.models.*
|
||||
import space.luminic.budgerapp.services.CategoryService
|
||||
import space.luminic.budgerapp.services.FinancialService
|
||||
@@ -103,10 +101,10 @@ class SpaceController(
|
||||
@PostMapping("/{spaceId}/budgets")
|
||||
fun createBudget(
|
||||
@PathVariable spaceId: String,
|
||||
@RequestBody budgetCreationDTO: BudgetCreationDTO,
|
||||
@RequestBody budget: Budget
|
||||
): Mono<Budget> {
|
||||
return spaceService.isValidRequest(spaceId).flatMap {
|
||||
financialService.createBudget(it, budgetCreationDTO.budget, budgetCreationDTO.createRecurrent)
|
||||
financialService.createBudget(it, budget)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -304,7 +302,7 @@ class SpaceController(
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/{spaceId}/recurrent")
|
||||
@PostMapping("/{spaceId}/recurrents")
|
||||
fun createRecurrent(@PathVariable spaceId: String, @RequestBody recurrent: Recurrent): Mono<Recurrent> {
|
||||
return spaceService.isValidRequest(spaceId).flatMap {
|
||||
recurrentService.createRecurrent(it, recurrent)
|
||||
@@ -312,7 +310,7 @@ class SpaceController(
|
||||
|
||||
}
|
||||
|
||||
@PutMapping("/{spaceId}/recurrent/{id}")
|
||||
@PutMapping("/{spaceId}/recurrents/{id}")
|
||||
fun editRecurrent(
|
||||
@PathVariable spaceId: String,
|
||||
@PathVariable id: String,
|
||||
|
||||
Reference in New Issue
Block a user