Skip to content

Commit

Permalink
fix rent name of proberty and preferences in body
Browse files Browse the repository at this point in the history
  • Loading branch information
julia05 committed Jun 20, 2024
1 parent 79146d5 commit a36a12d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
14 changes: 7 additions & 7 deletions frontend/vue-gewoscout/src/common/api-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import axios from 'axios';
interface ListingsParams {
listingType: string;
housingCooperative?: string; // geno
minRentPricePerMonth?: number;
maxRentPricePerMonth?: number;
minRentPrice?: number;
maxRentPrice?: number;
postalCode?: string;
minRoomCount?: number;
maxRoomCount?: number;
Expand Down Expand Up @@ -59,7 +59,7 @@ export async function getUserPreferences(): Promise<SearchInputs[]> {
export async function setUserPreferences(preferences: SearchInputs): Promise<boolean> {
try {
const response = await axios.put(`/api/users/preferences/${preferences.city}`, {
params: convertInputToOptionalParamsObj(preferences)
preferences
});

console.log(response);
Expand Down Expand Up @@ -105,11 +105,11 @@ function convertInputToOptionalParamsObj(input: SearchInputs): ListingsParams {
if (input.maxYearBuilt !== null) {
params.maxYearBuilt = input.maxYearBuilt;
}
if (input.minRentPricePerMonth !== null) {
params.minRentPricePerMonth = input.minRentPricePerMonth;
if (input.minRentPrice !== null) {
params.minRentPrice = input.minRentPrice;
}
if (input.maxRentPricePerMonth !== null) {
params.maxRentPricePerMonth = input.maxRentPricePerMonth;
if (input.maxRentPrice !== null) {
params.maxRentPrice = input.maxRentPrice;
}
if (input.minCooperativeShare !== null) {
params.minCooperativeShare = input.minCooperativeShare;
Expand Down
8 changes: 4 additions & 4 deletions frontend/vue-gewoscout/src/components/HeaderNavbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ const userPreferences: Ref<SearchInputs> = ref({
maxYearBuilt: null,
minHwgEnergyClass: null,
minFgeeEnergyClass: null,
minRentPricePerMonth: null,
maxRentPricePerMonth: null,
minRentPrice: null,
maxRentPrice: null,
minCooperativeShare: null,
maxCooperativeShare: null,
minSalePrice: null,
Expand Down Expand Up @@ -230,15 +230,15 @@ function logout() {
<div class="flex flex-row gap-2">
<InputNumber
inputId="priceFrom"
v-model="userPreferences.minRentPricePerMonth"
v-model="userPreferences.minRentPrice"
placeholder="from"
inputClass="w-full"
locale="de-DE"
/>
<p>-</p>
<InputNumber
inputId="priceTo"
v-model="userPreferences.maxRentPricePerMonth"
v-model="userPreferences.maxRentPrice"
placeholder="to"
inputClass="w-full"
locale="de-DE"
Expand Down
12 changes: 6 additions & 6 deletions frontend/vue-gewoscout/src/components/SearchForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const searchInputs: Ref<SearchInputs> = ref({
maxYearBuilt: null,
minHwgEnergyClass: null,
minFgeeEnergyClass: null,
minRentPricePerMonth: null,
maxRentPricePerMonth: null,
minRentPrice: null,
maxRentPrice: null,
minCooperativeShare: null,
maxCooperativeShare: null,
minSalePrice: null,
Expand Down Expand Up @@ -90,8 +90,8 @@ function reset() {
maxYearBuilt: null,
minHwgEnergyClass: null,
minFgeeEnergyClass: null,
minRentPricePerMonth: null,
maxRentPricePerMonth: null,
minRentPrice: null,
maxRentPrice: null,
minCooperativeShare: null,
maxCooperativeShare: null,
minSalePrice: null,
Expand Down Expand Up @@ -147,15 +147,15 @@ function reset() {
<div class="flex flex-row gap-2">
<InputNumber
inputId="priceFrom"
v-model="searchInputs.minRentPricePerMonth"
v-model="searchInputs.minRentPrice"
placeholder="from"
inputClass="w-full"
locale="de-DE"
/>
<p>-</p>
<InputNumber
inputId="priceTo"
v-model="searchInputs.maxRentPricePerMonth"
v-model="searchInputs.maxRentPrice"
placeholder="to"
inputClass="w-full"
locale="de-DE"
Expand Down
4 changes: 2 additions & 2 deletions frontend/vue-gewoscout/src/types/SearchInputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export default interface SearchInputs {
minHwgEnergyClass: EnergyClass | null;
minFgeeEnergyClass: EnergyClass | null;
listingType: Type;
minRentPricePerMonth: number | null;
maxRentPricePerMonth: number | null;
minRentPrice: number | null;
maxRentPrice: number | null;
minCooperativeShare: number | null;
maxCooperativeShare: number | null;
minSalePrice: number | null;
Expand Down

0 comments on commit a36a12d

Please sign in to comment.