Skip to content
Snippets Groups Projects
Commit 0c65872c authored by Erik Borgeteien Hansen's avatar Erik Borgeteien Hansen
Browse files

add back console logs

parent 5d31ffdc
No related branches found
No related tags found
1 merge request!88Community admin
...@@ -53,9 +53,9 @@ export default { ...@@ -53,9 +53,9 @@ export default {
async loadProfile() { async loadProfile() {
if (this.$store.state.user.token !== null) { if (this.$store.state.user.token !== null) {
let user = parseUserFromToken(this.$store.state.user.token); let user = parseUserFromToken(this.$store.state.user.token);
//console.log(user); console.log(user);
let id = user.accountId; let id = user.accountId;
//console.log(id); console.log(id);
await this.$router.push("/profile/" + id); await this.$router.push("/profile/" + id);
} else { } else {
await this.$router.push("/login"); await this.$router.push("/login");
......
...@@ -33,7 +33,7 @@ export default { ...@@ -33,7 +33,7 @@ export default {
}, },
methods: { methods: {
color() { color() {
//console.log(this.userID); console.log(this.userID);
return this?.message.from == this.userID return this?.message.from == this.userID
? "bg-gray-300" ? "bg-gray-300"
: "bg-primary-medium"; : "bg-primary-medium";
......
...@@ -52,7 +52,7 @@ export default { ...@@ -52,7 +52,7 @@ export default {
}, },
methods: { methods: {
selectUser() { selectUser() {
//console.log(this.conversation.recipient.userId); console.log(this.conversation.recipient.userId);
this.$emit("recipient", this.conversation.recipient.userId); this.$emit("recipient", this.conversation.recipient.userId);
}, },
}, },
......
...@@ -140,7 +140,7 @@ export default { ...@@ -140,7 +140,7 @@ 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); 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;
} }
......
...@@ -137,7 +137,7 @@ export default { ...@@ -137,7 +137,7 @@ export default {
this.v$.user.$touch(); this.v$.user.$touch();
if (this.v$.user.$invalid) { if (this.v$.user.$invalid) {
//console.log("Ugyldig, avslutter..."); console.log("Ugyldig, avslutter...");
return; return;
} }
...@@ -154,7 +154,7 @@ export default { ...@@ -154,7 +154,7 @@ export default {
this.$store.commit("saveToken", loginResponse.token); this.$store.commit("saveToken", loginResponse.token);
await this.$router.push("/"); await this.$router.push("/");
} else { } else {
//console.log("Something went wrong"); console.log("Something went wrong");
} }
}, },
}, },
......
...@@ -130,7 +130,7 @@ export default { ...@@ -130,7 +130,7 @@ export default {
this.v$.user.$touch(); this.v$.user.$touch();
if (this.v$.user.$invalid) { if (this.v$.user.$invalid) {
//console.log("Invalid, exiting..."); console.log("Invalid, exiting...");
return; return;
} }
...@@ -142,12 +142,12 @@ export default { ...@@ -142,12 +142,12 @@ export default {
const newPasswordResponse = doNewPassword(newPasswordInfo); const newPasswordResponse = doNewPassword(newPasswordInfo);
if (newPasswordResponse.newPasswordSet === true) { if (newPasswordResponse.newPasswordSet === true) {
//console.log("New password set"); console.log("New password set");
await this.$router.push("/"); await this.$router.push("/");
} else if (newPasswordResponse.newPasswordSet === false) { } else if (newPasswordResponse.newPasswordSet === false) {
//console.log("Couldn't set new password"); console.log("Couldn't set new password");
} else { } else {
//console.log("Something went wrong"); console.log("Something went wrong");
} }
}, },
validate() { validate() {
......
...@@ -83,7 +83,7 @@ export default { ...@@ -83,7 +83,7 @@ export default {
this.v$.email.$touch(); this.v$.email.$touch();
if (this.v$.email.$invalid) { if (this.v$.email.$invalid) {
//console.log("Ugyldig, avslutter..."); console.log("Ugyldig, avslutter...");
return; return;
} else { } else {
this.$router.push("/"); this.$router.push("/");
......
...@@ -311,36 +311,36 @@ export default { ...@@ -311,36 +311,36 @@ export default {
}, },
methods: { methods: {
checkValidation: function () { checkValidation: function () {
//console.log("sjekker validering"); console.log("sjekker validering");
this.v$.item.$touch(); this.v$.item.$touch();
if (this.v$.item.$invalid || this.item.selectedGroups.length === 0) { if (this.v$.item.$invalid || this.item.selectedGroups.length === 0) {
if (this.item.selectedGroups.length === 0) { if (this.item.selectedGroups.length === 0) {
this.groupErrorMessage = "Velg gruppe/grupper"; this.groupErrorMessage = "Velg gruppe/grupper";
} }
//console.log("Invalid, avslutter..."); console.log("Invalid, avslutter...");
return false; return false;
} }
//console.log("validert!"); console.log("validert!");
return true; return true;
}, },
async saveClicked() { async saveClicked() {
//console.log("Attempting to save item"); console.log("Attempting to save item");
if (this.checkValidation()) { if (this.checkValidation()) {
//console.log("validert, videre..."); console.log("validert, videre...");
this.checkUser(); this.checkUser();
//console.log("Tittel: " + this.item.title); console.log("Tittel: " + this.item.title);
//console.log("Kategori: " + this.item.select); console.log("Kategori: " + this.item.select);
//console.log("Beskrivelse: " + this.item.description); console.log("Beskrivelse: " + this.item.description);
//console.log("Addressen: " + this.item.address); console.log("Addressen: " + this.item.address);
//console.log("Pris: " + this.item.price); console.log("Pris: " + this.item.price);
//console.log("bilder: " + this.item.images); console.log("bilder: " + this.item.images);
//console.log("gruppe: " + this.item.selectedGroups); console.log("gruppe: " + this.item.selectedGroups);
const itemInfo = { const itemInfo = {
title: this.item.title, title: this.item.title,
...@@ -352,11 +352,11 @@ export default { ...@@ -352,11 +352,11 @@ export default {
communityIDs: this.item.selectedGroups, communityIDs: this.item.selectedGroups,
}; };
//console.log(itemInfo); console.log(itemInfo);
/* const postRequest = */ await postNewItem(itemInfo); /* const postRequest = */ await postNewItem(itemInfo);
//console.log("posted: " + postRequest); console.log("posted: " + postRequest);
this.$router.push("/"); this.$router.push("/");
} }
...@@ -368,7 +368,7 @@ export default { ...@@ -368,7 +368,7 @@ export default {
}, },
addImage: function (event) { addImage: function (event) {
//console.log(event.target.files); console.log(event.target.files);
this.item.images.push(URL.createObjectURL(event.target.files[0])); this.item.images.push(URL.createObjectURL(event.target.files[0]));
}, },
...@@ -379,7 +379,7 @@ export default { ...@@ -379,7 +379,7 @@ export default {
onChangeGroup: function (e) { onChangeGroup: function (e) {
this.selectedGroupId = e.target.value; this.selectedGroupId = e.target.value;
let alreadyInGroupList = false; let alreadyInGroupList = false;
//console.log("selected clicked"); console.log("selected clicked");
for (let i = 0; i <= this.item.selectedGroups.length; i++) { for (let i = 0; i <= this.item.selectedGroups.length; i++) {
if (this.selectedGroupId == this.item.selectedGroups[i]) { if (this.selectedGroupId == this.item.selectedGroups[i]) {
......
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
this.$emit("back", this.type); this.$emit("back", this.type);
}, },
forward() { forward() {
//console.log(this.type); console.log(this.type);
this.$emit("forward", this.type); this.$emit("forward", this.type);
}, },
}, },
......
...@@ -2,7 +2,7 @@ import { createApp } from "vue"; ...@@ -2,7 +2,7 @@ import { createApp } from "vue";
import App from "./App.vue"; import App from "./App.vue";
import router from "./router"; import router from "./router";
import store from "./store"; import store from "./store";
// import ws from "./services/ws"; import ws from "./services/ws";
createApp(App).use(router).use(store).mount("#app"); createApp(App).use(router).use(store).mount("#app");
//console.log("WS", ws.test); console.log("WS", ws.test);
...@@ -17,18 +17,18 @@ const ws = (function () { ...@@ -17,18 +17,18 @@ const ws = (function () {
const onMessageReceived = (payload) => { const onMessageReceived = (payload) => {
const data = JSON.parse(payload.body); const data = JSON.parse(payload.body);
//console.log("New message!"); console.log("New message!");
// Fire message event // Fire message event
fire("MESSAGE", JSON.parse(payload.body)); fire("MESSAGE", JSON.parse(payload.body));
if (data.status == "NEW_MESSAGE") if (data.status == "NEW_MESSAGE")
fire("NEW_MESSAGE", JSON.parse(payload.body)); fire("NEW_MESSAGE", JSON.parse(payload.body));
//console.log("Received message: " + payload); console.log("Received message: " + payload);
}; };
const onConnected = () => { const onConnected = () => {
//console.log("Websocket Connected"); console.log("Websocket Connected");
stompClient.subscribe( stompClient.subscribe(
"/user/" + parseCurrentUser().accountId + "/queue/messages", "/user/" + parseCurrentUser().accountId + "/queue/messages",
onMessageReceived onMessageReceived
......
...@@ -64,7 +64,7 @@ export default { ...@@ -64,7 +64,7 @@ export default {
this.selected = this.conversations.find( this.selected = this.conversations.find(
(conversation) => conversation.recipient.userId == userid (conversation) => conversation.recipient.userId == userid
).recipient; ).recipient;
//console.log(this.selected); console.log(this.selected);
}, },
}, },
async created() { async created() {
......
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