#17 #16
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
scammo
2021-08-18 14:34:28 +02:00
parent 096c317da8
commit 513d204d58
4 changed files with 149 additions and 171 deletions

View File

@ -58,7 +58,6 @@ export default {
async submitLogin() {
this.showErrorMessage = false;
try {
console.log(this.apiUrl)
const loginResult = await axios.post(
`${this.apiUrl}/users/login`,
{
@ -66,10 +65,7 @@ export default {
password: this.password,
}
);
console.log(loginResult);
console.log(loginResult.status);
if (loginResult.status === 200) {
console.log('if true')
this.showErrorMessage = false;
//success login
localStorage.setItem("token", loginResult.data.token);

View File

@ -5,17 +5,29 @@
<form @submit.prevent="submitForm()">
<div class="row">
<div class="col">
<input type="radio" id="false" :value="false" v-model="profile.visible" class="mr-2"/>
<input
type="radio"
id="false"
:value="false"
v-model="profile.visible"
class="mr-2"
/>
<label for="false" class="m-2 fw-bold"> Nicht öffentlich</label>
</div>
<div class="col">
<input type="radio" id="true" :value="true" v-model="profile.visible" />
<input
type="radio"
id="true"
:value="true"
v-model="profile.visible"
/>
<label for="true" class="m-2 fw-bold"> Öffentlich</label>
</div>
</div>
<div id="visibilityHelp" class="form-text">
Erst wenn du dein Profil Öffentlich stellst, können andere Genoss:innen darauf zugreifen oder es in der Suche finden.
</div>
Erst wenn du dein Profil Öffentlich stellst, können andere Genoss:innen
darauf zugreifen oder es in der Suche finden.
</div>
<div class="row">
<div class="col-6 col-xs-12">
<label for="nickname" class="form-label fw-bold">Nickname:</label>
@ -82,16 +94,16 @@
></auto-complete>
<div class="col-12 col-xs-12">
<label for="availability" class="form-label fw-bold"
>Ich bin für Anfragen verfügbar:</label
>
<textarea
class="form-control"
id="availability"
rows="3"
v-model="profile.availability"
></textarea>
</div>
<label for="availability" class="form-label fw-bold"
>Ich bin für Anfragen verfügbar:</label
>
<textarea
class="form-control"
id="availability"
rows="3"
v-model="profile.availability"
></textarea>
</div>
<auto-complete
type="contacttype"
@ -130,7 +142,9 @@
</div>
</div>
<button type="submit" class="btn btn-outline-success mb-4 mt-4 col-12">Speichern</button>
<button type="submit" class="btn btn-outline-success mb-4 mt-4 col-12">
Speichern
</button>
<div
class="alert alert-danger mb-4 mt-4"
role="alert"
@ -183,9 +197,7 @@ export default {
async created() {
try {
const userProfile = await axios.get(
`${this.apiUrl}/users/${localStorage.getItem(
"user_id"
)}/profile`,
`${this.apiUrl}/users/${localStorage.getItem("user_id")}/profile`,
{
headers: { Authorization: `Bearer ${localStorage.getItem("token")}` },
}
@ -199,9 +211,7 @@ export default {
async submitForm() {
try {
const formSubmitResult = await axios.post(
`${this.apiUrl}/users/${localStorage.getItem(
"user_id"
)}/profile`,
`${this.apiUrl}/users/${localStorage.getItem("user_id")}/profile`,
this.profile,
{
headers: {
@ -220,7 +230,7 @@ export default {
console.error(error);
this.showErrorMessage = true;
}
}
},
},
};
</script>