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 { ...@@ -53,9 +53,7 @@ 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);
let id = user.accountId; let id = user.accountId;
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,6 @@ export default { ...@@ -33,7 +33,6 @@ export default {
}, },
methods: { methods: {
color() { color() {
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,6 @@ export default { ...@@ -52,7 +52,6 @@ export default {
}, },
methods: { methods: {
selectUser() { selectUser() {
console.log(this.conversation.recipient.userId);
this.$emit("recipient", this.conversation.recipient.userId); this.$emit("recipient", this.conversation.recipient.userId);
}, },
}, },
......
...@@ -127,8 +127,6 @@ export default { ...@@ -127,8 +127,6 @@ export default {
this.$route.params.communityID this.$route.params.communityID
); );
for (let i = 0; i < members.length; i++) { 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) { if (members[i].userId == this.userid) {
this.member = true; this.member = true;
return; return;
......
...@@ -100,9 +100,7 @@ export default { ...@@ -100,9 +100,7 @@ export default {
getCommunityFromAPI: async function () { getCommunityFromAPI: async function () {
this.communityID = await this.$router.currentRoute.value.params this.communityID = await this.$router.currentRoute.value.params
.communityID; .communityID;
console.log("Dette er community id =" + this.communityID);
this.community = await GetCommunity(this.communityID); this.community = await GetCommunity(this.communityID);
console.log(this.community);
}, },
}, },
async created() { async created() {
......
...@@ -137,7 +137,6 @@ export default { ...@@ -137,7 +137,6 @@ export default {
this.v$.user.$touch(); this.v$.user.$touch();
if (this.v$.user.$invalid) { if (this.v$.user.$invalid) {
console.log("Ugyldig, avslutter...");
return; return;
} }
...@@ -153,8 +152,6 @@ export default { ...@@ -153,8 +152,6 @@ export default {
} else if (loginResponse.isLoggedIn === true) { } else if (loginResponse.isLoggedIn === true) {
this.$store.commit("saveToken", loginResponse.token); this.$store.commit("saveToken", loginResponse.token);
await this.$router.push("/"); await this.$router.push("/");
} else {
console.log("Something went wrong");
} }
}, },
}, },
......
...@@ -130,7 +130,6 @@ export default { ...@@ -130,7 +130,6 @@ export default {
this.v$.user.$touch(); this.v$.user.$touch();
if (this.v$.user.$invalid) { if (this.v$.user.$invalid) {
console.log("Invalid, exiting...");
return; return;
} }
...@@ -139,25 +138,9 @@ export default { ...@@ -139,25 +138,9 @@ export default {
const newPasswordResponse = await doNewPassword(newPassword); const newPasswordResponse = await doNewPassword(newPassword);
if (newPasswordResponse != null) { if (newPasswordResponse != null) {
console.log("New password set");
this.$store.commit("saveToken", newPasswordResponse); this.$store.commit("saveToken", newPasswordResponse);
await this.$router.push("/"); 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() { validate() {
this.$refs.form.validate(); this.$refs.form.validate();
......
...@@ -83,7 +83,6 @@ export default { ...@@ -83,7 +83,6 @@ export default {
this.v$.email.$touch(); this.v$.email.$touch();
if (this.v$.email.$invalid) { if (this.v$.email.$invalid) {
console.log("Ugyldig, avslutter...");
return; return;
} else { } else {
this.$router.push("/"); this.$router.push("/");
......
...@@ -311,37 +311,19 @@ export default { ...@@ -311,37 +311,19 @@ export default {
}, },
methods: { methods: {
checkValidation: function () { checkValidation: function () {
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...");
return false; return false;
} }
console.log("validert!");
return true; return true;
}, },
async saveClicked() { async saveClicked() {
console.log("Attempting to save item");
if (this.checkValidation()) { if (this.checkValidation()) {
console.log("validert, videre...");
this.checkUser(); 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 = { const itemInfo = {
title: this.item.title, title: this.item.title,
description: this.item.description, description: this.item.description,
...@@ -351,12 +333,7 @@ export default { ...@@ -351,12 +333,7 @@ export default {
categoryNames: [], categoryNames: [],
communityIDs: this.item.selectedGroups, communityIDs: this.item.selectedGroups,
}; };
await postNewItem(itemInfo);
console.log(itemInfo);
const postRequest = await postNewItem(itemInfo);
console.log("posted: " + postRequest);
this.$router.push("/"); this.$router.push("/");
} }
...@@ -368,7 +345,6 @@ export default { ...@@ -368,7 +345,6 @@ export default {
}, },
addImage: function (event) { addImage: function (event) {
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 +355,6 @@ export default { ...@@ -379,7 +355,6 @@ 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");
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,6 @@ export default { ...@@ -81,7 +81,6 @@ export default {
this.$emit("back", this.type); this.$emit("back", this.type);
}, },
forward() { forward() {
console.log(this.type);
this.$emit("forward", this.type); this.$emit("forward", this.type);
}, },
}, },
......
...@@ -2,7 +2,5 @@ import { createApp } from "vue"; ...@@ -2,7 +2,5 @@ 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";
createApp(App).use(router).use(store).mount("#app"); createApp(App).use(router).use(store).mount("#app");
console.log("WS", ws.test);
...@@ -17,18 +17,15 @@ const ws = (function () { ...@@ -17,18 +17,15 @@ 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!");
// 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);
}; };
const onConnected = () => { const onConnected = () => {
console.log("Websocket Connected");
stompClient.subscribe( stompClient.subscribe(
"/user/" + parseCurrentUser().accountId + "/queue/messages", "/user/" + parseCurrentUser().accountId + "/queue/messages",
onMessageReceived onMessageReceived
...@@ -57,7 +54,6 @@ const ws = (function () { ...@@ -57,7 +54,6 @@ const ws = (function () {
} }
}, },
sendMessage: ({ sender, recipient /* , status */ }) => { sendMessage: ({ sender, recipient /* , status */ }) => {
//if (status) console.log(status);
stompClient.send( stompClient.send(
"/app/chat", "/app/chat",
{}, {},
......
...@@ -97,7 +97,7 @@ export async function doNewPassword(password) { ...@@ -97,7 +97,7 @@ export async function doNewPassword(password) {
return response; return response;
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.error(error);
}); });
return res.data; return res.data;
} }
...@@ -108,7 +108,6 @@ export function postNewItem(itemInfo) { ...@@ -108,7 +108,6 @@ export function postNewItem(itemInfo) {
headers: tokenHeader(), headers: tokenHeader(),
}) })
.then((response) => { .then((response) => {
console.log("poster: " + response.data);
return response; return response;
}) })
.catch((error) => { .catch((error) => {
...@@ -134,7 +133,6 @@ export function postNewRent(rentInfo) { ...@@ -134,7 +133,6 @@ export function postNewRent(rentInfo) {
headers: tokenHeader(), headers: tokenHeader(),
}) })
.then((response) => { .then((response) => {
console.log("poster: " + response.data);
return response; return response;
}) })
.catch((error) => { .catch((error) => {
...@@ -237,7 +235,6 @@ export async function GetMembersOfCommunity(communityID) { ...@@ -237,7 +235,6 @@ export async function GetMembersOfCommunity(communityID) {
export function JoinOpenCommunity(communityId) { export function JoinOpenCommunity(communityId) {
if (tokenHeader().Authorization == "Bearer " + null) { if (tokenHeader().Authorization == "Bearer " + null) {
console.log("ikke logget på!");
return "Login to join any community"; return "Login to join any community";
} }
......
...@@ -64,7 +64,6 @@ export default { ...@@ -64,7 +64,6 @@ 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);
}, },
}, },
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