Skip to content

Commit

Permalink
HOTFIX: EDIT PLAN REQUEST
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-GF committed Mar 21, 2024
1 parent be390b1 commit b2974c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions frontend/src/admin/plans/PlanEditAdmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ export default function PlanEditAdmin() {

function handleChange(event) {
const target = event.target;
const value = target.value;
let value;
try{
value = parseInt(target.value);
} catch (error){
value = target.value;
}

const name = target.name;

setPlan({ ...plan, [name]: value });
Expand All @@ -64,9 +70,7 @@ export default function PlanEditAdmin() {
})
.then((response) => response.json())
.then((json) => {
console.log(json.message);
console.log(json.message.startsWith("Plan"));
if (json.message && !json.message.startsWith("Plan")) {
if (json.message) {
setMessage(json.message);
setVisible(true);
} else window.location.href = "/plansAdmin";
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/pricing/petclinic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ plans:
havePetsDashboard:
value: false
haveVetSelection:
value: false
value: true
haveOnlineConsultation:
value: false
usageLimits:
maxPets:
value: 2
value: 3
maxVisitsPerMonthAndPet:
value: 1
GOLD:
Expand Down

0 comments on commit b2974c1

Please sign in to comment.