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

lint

parent 826660dd
No related branches found
No related tags found
1 merge request!88Community admin
Pipeline #180041 passed
......@@ -8,20 +8,19 @@
<div class="flex justify-center p-2">
<!-- If a user is not a member in the community, this button will show -->
<ColoredButton
v-if="!member && community.visibility!==0"
v-if="!member && community.visibility !== 0"
:text="'Bli med'"
@click="goToJoin(community.communityId)"
class="m-2"
/>
<ColoredButton
v-if="!member && community.visibility===0"
<ColoredButton
v-if="!member && community.visibility === 0"
:text="'Spør om å bli med'"
@click="goToRequest(community.communityId)"
class="m-2"
/>
/>
<!-- If a user is member this button will show -->
<ColoredButton
v-if="member"
......@@ -104,8 +103,8 @@ export default {
this.$router.push("/community/" + id);
}
},
goToRequest(id){
this.$router.push("/community/" + id + "/private/join")
goToRequest(id) {
this.$router.push("/community/" + id + "/private/join");
},
toggleDialog() {
this.dialogOpen = !this.dialogOpen;
......
......@@ -6,17 +6,17 @@
<div
class="text-xl md:text-2xl font-medium text-center text-gray-600 dark:text-gray-200 mt-4 mb-10"
>
Bli med i: {{community.name}}
Bli med i: {{ community.name }}
</div>
<!-- message -->
<div class="mt-6" :class="{ error: v$.message.$errors.length }">
<label
class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-400"
id="messageLabel"
> Melding til administrator av gruppa: </label
>
Melding til administrator av gruppa:
</label>
<textarea
id="message"
rows="4"
......@@ -49,8 +49,8 @@ import axios from "axios";
import useVuelidate from "@vuelidate/core";
import { required, helpers, maxLength } from "@vuelidate/validators";
import Button from "@/components/BaseComponents/ColoredButton";
import {tokenHeader} from "@/utils/token-utils";
import {GetCommunity} from "@/utils/apiutil";
import { tokenHeader } from "@/utils/token-utils";
import { GetCommunity } from "@/utils/apiutil";
export default {
name: "CommunityRequestForm.vue",
......@@ -64,45 +64,48 @@ export default {
validations() {
return {
message: {
required: helpers.withMessage(
() => "Meldingen kan ikke være tom",
required
),
max: helpers.withMessage(
() => `Meldingen kan inneholde max 200 tegn`,
maxLength(200)
),
},
message: {
required: helpers.withMessage(
() => "Meldingen kan ikke være tom",
required
),
max: helpers.withMessage(
() => `Meldingen kan inneholde max 200 tegn`,
maxLength(200)
),
},
};
},
data() {
return {
message: "",
communityId: null,
community: {},
message: "",
communityId: null,
community: {},
};
},
computed: {
},
computed: {},
methods: {
//TODO fix so that community id is set (not null)
async saveClicked() {
this.communityID = await this.$router.currentRoute.value.params
this.communityID = await this.$router.currentRoute.value.params
.communityID;
await axios.post(process.env.VUE_APP_BASEURL+ `communities/${this.communityID}/private/join`, {message: this.message, }, {headers: tokenHeader()} );
await axios.post(
process.env.VUE_APP_BASEURL +
`communities/${this.communityID}/private/join`,
{ message: this.message },
{ headers: tokenHeader() }
);
},
getCommunityFromAPI: async function () {
getCommunityFromAPI: async function () {
this.communityID = await this.$router.currentRoute.value.params
.communityID;
console.log("Dette er community id =" + this.communityID)
console.log("Dette er community id =" + this.communityID);
this.community = await GetCommunity(this.communityID);
console.log(this.community)
}
console.log(this.community);
},
},
async created() {
async created() {
await this.getCommunityFromAPI(); //To get the id of the community before mounting the view
},
};
......
......@@ -222,8 +222,6 @@ export async function GetListingsInCommunity(communityID) {
});
}
export async function GetMembersOfCommunity(communityID) {
return axios
.get(API_URL + "community/" + communityID + "/members", {
......
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