added get functions

This commit is contained in:
2024-02-08 13:12:01 +01:00
parent 73d0b89b4d
commit c91f9a53b6
31 changed files with 6614 additions and 2442 deletions

View File

@ -46,10 +46,12 @@
<script setup>
import { useRouter } from 'vue-router';
import { ref } from 'vue';
import Axios from '../axios.config.js';
import serversideConfig from '../serversideConfig.js';
const router = useRouter();
const darkMode = ref(true);
const isError = ref(false);
const errorMsg = ref('');
@ -73,7 +75,7 @@ const handleLogin = async () => {
console.log(res.data)
// sucessfully logged in
this.$router.push('/')
router.push('/')
} catch (err) {
// handle the error
console.log(err.response.statusText)
@ -128,6 +130,7 @@ const testFunctionSignup = async () => {
} catch (err) {
// handle the error
// console.log(err)
console.log(err.response.statusText)
isError.value = true;
errorMsg.value = err.response.statusText;
@ -143,87 +146,7 @@ export default {
// isError: false,
// errorMsg: '',
}
},
// methods: {
// async handleLogin() {
// this.isError = false;
// this.errorMsg = '';
// const username = document.getElementById('username-input').value;
// const password = document.getElementById('password-input').value;
// const requestBody = {
// username: username,
// password: password,
// }
// try {
// let res = await Axios.post(`https://${serversideConfig.url}:3000/api/login`, requestBody);
// // something to do with the res?
// console.log(res.data)
// // sucessfully logged in
// this.$router.push('/')
// } catch (err) {
// // handle the error
// console.log(err.response.statusText)
// this.isError = true;
// this.errorMsg = err.response.statusText;
// }
// },
// async testFunctionSignup() {
// this.isError = false;
// this.errorMsg = '';
// const username = 'maria'
// const password = 'maria123'
// const password_repeat = 'maria123'
// const fullName = 'hallo'
// const email = 'test.sdj@web.de'
// const phonenumber = '015736283729'
// const address = 'Strasse'
// const city = 'tuebingen'
// const postcode = '72121'
// const adminBool = false
// const technician1Bool = false
// const technician2Bool = false
// const technicianMonitoringBool = false
// const merchantBool = false
// const internBool = true
// const requestBody = {
// username: username,
// password: password,
// password_repeat: password_repeat,
// fullName: fullName,
// email: email,
// phonenumber: phonenumber,
// address: address,
// city: city,
// postcode: postcode,
// adminBool: adminBool,
// technician1Bool: technician1Bool,
// technician2Bool: technician2Bool,
// technicianMonitoringBool: technicianMonitoringBool,
// merchantBool: merchantBool,
// internBool: internBool,
// }
// try {
// let res = await Axios.post(`https://${serversideConfig.url}:3000/api/signup`, requestBody);
// // something to do with the res?
// console.log(res.data)
// } catch (err) {
// // handle the error
// console.log(err.response.statusText)
// this.isError = true;
// this.errorMsg = err.response.statusText;
// }
// }
// }
}
}
</script>