Skip to content

Dynamic host rating bars API, sanitiseData, adjusted error responses and bug fixes#75

Merged
Prakhar896 merged 19 commits intomainfrom
joshua
Jul 28, 2024
Merged

Dynamic host rating bars API, sanitiseData, adjusted error responses and bug fixes#75
Prakhar896 merged 19 commits intomainfrom
joshua

Conversation

@Sadliquid
Copy link
Copy Markdown
Contributor

@Sadliquid Sadliquid commented Jul 24, 2024

What was done in this PR

1.) Replaced auth middleware's code with the updated one which @Prakhar896 provided
2.) Fixed bug where yup's date validation caused an invalid date
3.) Added API for caluclating the progress percentage which is used by the host's rating bars
4.) Shifted all aggregation and calculation logic to the backend to ease the load on frontend
5.) Added a little extra validation for adding a listing on backend
6.) Implemented sanitiseData
7.) Adjusted error responses, and standardised error types
8.) Added slight changes to accept publishInstantly

@Sadliquid Sadliquid added the enhancement New feature or request label Jul 24, 2024
@Sadliquid Sadliquid requested a review from Prakhar896 July 24, 2024 16:08
Comment thread routes/cdn/contentDelivery.js Outdated
Comment thread routes/cdn/coreData.js
Comment thread routes/identity/MakanHistory.js Outdated
Comment thread routes/listings/listings.js Outdated
Comment thread routes/listings/listings.js Outdated
Comment thread routes/listings/listings.js Outdated
Comment thread routes/listings/listings.js Outdated
Comment thread routes/listings/listings.js Outdated
Comment thread routes/listings/listings.js Outdated
@Sadliquid Sadliquid requested a review from Prakhar896 July 26, 2024 05:19
Comment thread routes/cdn/contentDelivery.js
Comment thread routes/identity/MakanHistory.js Outdated
Comment thread routes/identity/MakanHistory.js
@Sadliquid Sadliquid requested a review from Prakhar896 July 28, 2024 02:26
return res.status(400).send("ERROR: One or more required payloads were not provided");
}
try {
const user = await Guest.findByPk(userID) || await Host.findByPk(userID);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do take note that, in the future, you have to just do Guest.findByPk as we discussed that Hosts will just be solely hosts and unable to make reservations. @Sadliquid

Copy link
Copy Markdown
Contributor

@Prakhar896 Prakhar896 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Do note my comment about the reservations and also do note that you can avoid reduce indentation levels by omitting else for a if chain which has a return in it. @Sadliquid

@Prakhar896 Prakhar896 merged commit d60a8db into main Jul 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants