Skip to content

Commit

Permalink
fixed schema column naming issue, edit a single ride + delete all rid…
Browse files Browse the repository at this point in the history
…es now work as expected
  • Loading branch information
namanhboi committed Nov 13, 2024
1 parent c7c44b7 commit 88cd652
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions frontend/src/components/Modal/DeleteOrEditTypeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ const DeleteOrEditTypeModal = ({
currentRide = currentRide!.parentRide;
}
// now current ride is at the beginning of linked list
console.log(currentRide);
while (currentRide !== undefined) {
console.log("hello, deleting all, current Ride is", currentRide);
axios.delete(`/api/rides/${currentRide.id}`);
Expand Down
11 changes: 6 additions & 5 deletions frontend/src/components/RideModal/RideModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,8 @@ const RideModal = ({ open, close, ride }: RideModalProps) => {
rider : ride.sourceRide!.rider,
startLocation : ride.sourceRide!.startLocation.id,
endLocation : ride.sourceRide!.endLocation.id,
parentRideId : ride!.parentRideId,
childRideId : ride!.childRideId,
parentRideId : ride!.sourceRide.parentRideId,
childRideId : ride!.sourceRide.childRideId,
recurring : true,
recurringDays : ride!.sourceRide!.recurringDays!,
endDate : ride!.sourceRide.endDate!
Expand Down Expand Up @@ -411,16 +411,17 @@ const RideModal = ({ open, close, ride }: RideModalProps) => {
childRideId : newSingleRideData.id,
childRide : newSingleRideData
}
axios.put(`/api/rides/${ride.id}`, {
console.log("Child ride id is", ride.sourceRide!.childRideId, "source ride id is ", ride.sourceRide.id)
axios.put(`/api/rides/${ride.sourceRide.id}`, {
type : ride.sourceRide!.type,
startTime : ride.sourceRide!.startTime,
endTime : ride.sourceRide!.endTime,
driver : ride.sourceRide!.driver,
rider : ride.sourceRide!.rider,
startLocation : ride.sourceRide!.startLocation.id,
endLocation : ride.sourceRide!.endLocation.id,
parentRideId : ride!.parentRideId,
childRideId : ride!.childRideId,
parentRideId : ride!.sourceRide.parentRideId,
childRideId : ride!.sourceRide.childRideId,
recurring : true,
recurringDays : ride!.sourceRide!.recurringDays!,
endDate : (format_date(ride!.sourceRide.endDate!))
Expand Down
2 changes: 1 addition & 1 deletion server/src/models/ride.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const schema = new dynamoose.Schema({
type : String,
required : false,
},
childrenRideId : {
childRideId : {
type : String,
required : false,
},
Expand Down

0 comments on commit 88cd652

Please sign in to comment.