Profil ansehen Technisch Abgeschlossen

This commit is contained in:
scammo
2021-07-26 17:10:28 +02:00
parent 95e1c14afe
commit b911c52375
6 changed files with 147 additions and 58 deletions

View File

@ -9,7 +9,6 @@
class="form-control"
id="searchText"
v-model="searchText"
required
/>
</div>
<div class="col">
@ -29,7 +28,6 @@
</div>
</template>
<script>
import axios from "axios";
export default {
name: "Search",
@ -43,21 +41,18 @@ export default {
async submitSearch() {
this.showErrorMessage = false;
try {
const loginResult = await axios.post(
`${process.env.VUE_APP_API_URL}/search`,
// Beispiel Hafte Daten
const result = await this.axios.get(
`${process.env.VUE_APP_API_URL}/users/profiles`,
{
searchText: this.searchText,
headers: {
Authorization: `Bearer ${localStorage.getItem("token")}`,
},
}
);
if (loginResult.status === 200) {
//success login
this.router.push({ path: "s/search" });
} else {
this.showErrorMessage = true;
}
console.log(result)
} catch (error) {
console.error();
console.error(error);
this.showErrorMessage = true;
}
},