Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
henilp105 committed Apr 18, 2024
1 parent 0aca45a commit 3a6fae5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions frontend/src/store/actions/ratePackageActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ export const ratePackage = (data, access_token) => async (dispatch) => {

let packageName = data.package;
let namespaceName = data.namespace;
console.log("Rating package: ", access_token);
if(access_token === null){
// exit this function early if we don't have an access token
dispatch({
type: RATE_PACKAGE_FAILURE,
payload: {
message: "Unauthorized to rate packages. Please login to rate packages.",
statuscode: "403",
},
});
return;
}


try {
dispatch({
Expand Down

0 comments on commit 3a6fae5

Please sign in to comment.