Skip to content
Snippets Groups Projects
Commit 598c299a authored by Zara Mudassar's avatar Zara Mudassar
Browse files

Merge branch 'main' into search-groups

parents 4cc5409e 2b976bc8
No related branches found
No related tags found
1 merge request!93Search and paginate group lists
...@@ -138,7 +138,6 @@ export default { ...@@ -138,7 +138,6 @@ export default {
this.items = await GetListingsInCommunity(this.communityID); this.items = await GetListingsInCommunity(this.communityID);
for (var i = 0; i < this.items.length; i++) { for (var i = 0; i < this.items.length; i++) {
let images = await getItemPictures(this.items[i].listingID); let images = await getItemPictures(this.items[i].listingID);
console.log(images);
if (images.length > 0) { if (images.length > 0) {
this.items[i].img = images[0].picture; this.items[i].img = images[0].picture;
} }
......
...@@ -134,12 +134,19 @@ export default { ...@@ -134,12 +134,19 @@ export default {
return; return;
} }
const newPasswordInfo = { const newPassword = this.user.password;
token: this.token,
newPassword: this.password,
};
const newPasswordResponse = doNewPassword(newPasswordInfo); const newPasswordResponse = await doNewPassword(newPassword);
if (newPasswordResponse != null) {
console.log("New password set");
this.$store.commit("saveToken", newPasswordResponse);
await this.$router.push("/");
} else {
console.log("Couldn't set new password");
}
/*
if (newPasswordResponse.newPasswordSet === true) { if (newPasswordResponse.newPasswordSet === true) {
console.log("New password set"); console.log("New password set");
...@@ -149,6 +156,8 @@ export default { ...@@ -149,6 +156,8 @@ export default {
} else { } else {
console.log("Something went wrong"); console.log("Something went wrong");
} }
*/
}, },
validate() { validate() {
this.$refs.form.validate(); this.$refs.form.validate();
......
...@@ -84,15 +84,22 @@ export function getAverageRating(userid) { ...@@ -84,15 +84,22 @@ export function getAverageRating(userid) {
console.error(error); console.error(error);
}); });
} }
export function doNewPassword() { export async function doNewPassword(password) {
//m let res = await axios({
//add newPasswordInfo to input method: "put",
const auth = { newPasswordSet: false }; url: API_URL + "user/profile/password",
//return axios headers: tokenHeader(),
//.post(API_URL + "newPassword", newPasswordInfo) data: {
//.then((response) => {auth.newPasswordSet = true;return auth;}) password: password,
//.catch((error) => {console.log(error);return auth;}); },
return auth; //remove after axios is added })
.then((response) => {
return response;
})
.catch((error) => {
console.log(error);
});
return res.data;
} }
export function postNewItem(itemInfo) { export function postNewItem(itemInfo) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment