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

remove console logs

parent 95a9cc69
No related branches found
No related tags found
1 merge request!88Community admin
Pipeline #180064 passed
Showing
with 2 additions and 67 deletions
......@@ -53,9 +53,7 @@ export default {
async loadProfile() {
if (this.$store.state.user.token !== null) {
let user = parseUserFromToken(this.$store.state.user.token);
console.log(user);
let id = user.accountId;
console.log(id);
await this.$router.push("/profile/" + id);
} else {
await this.$router.push("/login");
......
......@@ -33,7 +33,6 @@ export default {
},
methods: {
color() {
console.log(this.userID);
return this?.message.from == this.userID
? "bg-gray-300"
: "bg-primary-medium";
......
......@@ -52,7 +52,6 @@ export default {
},
methods: {
selectUser() {
console.log(this.conversation.recipient.userId);
this.$emit("recipient", this.conversation.recipient.userId);
},
},
......
......@@ -127,8 +127,6 @@ export default {
this.$route.params.communityID
);
for (let i = 0; i < members.length; i++) {
console.log(members[i].userId + " vs " + this.userid);
console.log(members[i].userId == this.userid);
if (members[i].userId == this.userid) {
this.member = true;
return;
......
......@@ -100,9 +100,7 @@ export default {
getCommunityFromAPI: async function () {
this.communityID = await this.$router.currentRoute.value.params
.communityID;
console.log("Dette er community id =" + this.communityID);
this.community = await GetCommunity(this.communityID);
console.log(this.community);
},
},
async created() {
......
......@@ -137,7 +137,6 @@ export default {
this.v$.user.$touch();
if (this.v$.user.$invalid) {
console.log("Ugyldig, avslutter...");
return;
}
......@@ -153,8 +152,6 @@ export default {
} else if (loginResponse.isLoggedIn === true) {
this.$store.commit("saveToken", loginResponse.token);
await this.$router.push("/");
} else {
console.log("Something went wrong");
}
},
},
......
......@@ -130,7 +130,6 @@ export default {
this.v$.user.$touch();
if (this.v$.user.$invalid) {
console.log("Invalid, exiting...");
return;
}
......@@ -139,25 +138,9 @@ export default {
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) {
console.log("New password set");
await this.$router.push("/");
} else if (newPasswordResponse.newPasswordSet === false) {
console.log("Couldn't set new password");
} else {
console.log("Something went wrong");
}
*/
},
validate() {
this.$refs.form.validate();
......
......@@ -83,7 +83,6 @@ export default {
this.v$.email.$touch();
if (this.v$.email.$invalid) {
console.log("Ugyldig, avslutter...");
return;
} else {
this.$router.push("/");
......
......@@ -311,37 +311,19 @@ export default {
},
methods: {
checkValidation: function () {
console.log("sjekker validering");
this.v$.item.$touch();
if (this.v$.item.$invalid || this.item.selectedGroups.length === 0) {
if (this.item.selectedGroups.length === 0) {
this.groupErrorMessage = "Velg gruppe/grupper";
}
console.log("Invalid, avslutter...");
return false;
}
console.log("validert!");
return true;
},
async saveClicked() {
console.log("Attempting to save item");
if (this.checkValidation()) {
console.log("validert, videre...");
this.checkUser();
console.log("Tittel: " + this.item.title);
console.log("Kategori: " + this.item.select);
console.log("Beskrivelse: " + this.item.description);
console.log("Addressen: " + this.item.address);
console.log("Pris: " + this.item.price);
console.log("bilder: " + this.item.images);
console.log("gruppe: " + this.item.selectedGroups);
const itemInfo = {
title: this.item.title,
description: this.item.description,
......@@ -351,12 +333,7 @@ export default {
categoryNames: [],
communityIDs: this.item.selectedGroups,
};
console.log(itemInfo);
const postRequest = await postNewItem(itemInfo);
console.log("posted: " + postRequest);
await postNewItem(itemInfo);
this.$router.push("/");
}
......@@ -368,7 +345,6 @@ export default {
},
addImage: function (event) {
console.log(event.target.files);
this.item.images.push(URL.createObjectURL(event.target.files[0]));
},
......@@ -379,7 +355,6 @@ export default {
onChangeGroup: function (e) {
this.selectedGroupId = e.target.value;
let alreadyInGroupList = false;
console.log("selected clicked");
for (let i = 0; i <= this.item.selectedGroups.length; i++) {
if (this.selectedGroupId == this.item.selectedGroups[i]) {
......
......@@ -81,7 +81,6 @@ export default {
this.$emit("back", this.type);
},
forward() {
console.log(this.type);
this.$emit("forward", this.type);
},
},
......
......@@ -2,7 +2,5 @@ import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import ws from "./services/ws";
createApp(App).use(router).use(store).mount("#app");
console.log("WS", ws.test);
......@@ -17,18 +17,15 @@ const ws = (function () {
const onMessageReceived = (payload) => {
const data = JSON.parse(payload.body);
console.log("New message!");
// Fire message event
fire("MESSAGE", JSON.parse(payload.body));
if (data.status == "NEW_MESSAGE")
fire("NEW_MESSAGE", JSON.parse(payload.body));
console.log("Received message: " + payload);
};
const onConnected = () => {
console.log("Websocket Connected");
stompClient.subscribe(
"/user/" + parseCurrentUser().accountId + "/queue/messages",
onMessageReceived
......@@ -57,7 +54,6 @@ const ws = (function () {
}
},
sendMessage: ({ sender, recipient /* , status */ }) => {
//if (status) console.log(status);
stompClient.send(
"/app/chat",
{},
......
......@@ -97,7 +97,7 @@ export async function doNewPassword(password) {
return response;
})
.catch((error) => {
console.log(error);
console.error(error);
});
return res.data;
}
......@@ -108,7 +108,6 @@ export function postNewItem(itemInfo) {
headers: tokenHeader(),
})
.then((response) => {
console.log("poster: " + response.data);
return response;
})
.catch((error) => {
......@@ -134,7 +133,6 @@ export function postNewRent(rentInfo) {
headers: tokenHeader(),
})
.then((response) => {
console.log("poster: " + response.data);
return response;
})
.catch((error) => {
......@@ -237,7 +235,6 @@ export async function GetMembersOfCommunity(communityID) {
export function JoinOpenCommunity(communityId) {
if (tokenHeader().Authorization == "Bearer " + null) {
console.log("ikke logget på!");
return "Login to join any community";
}
......
......@@ -64,7 +64,6 @@ export default {
this.selected = this.conversations.find(
(conversation) => conversation.recipient.userId == userid
).recipient;
console.log(this.selected);
},
},
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