Skip to content
Snippets Groups Projects

Added ability for studass to pick students and remove them from queue.

Merged Kristian Valset Aars requested to merge SubjectNav into master
17 files
+ 507
74
Compare changes
  • Side-by-side
  • Inline
Files
17
@@ -13,7 +13,7 @@
<label for="password">Password:</label>
<input type="password" id="password" required v-model="password">
<button type="submit" @click="handleLogin">Logg inn</button>
<button type="submit">Logg inn</button>
</form>
</div>
@@ -23,6 +23,7 @@
import ErrorBox from './ErrorBox.vue'
import LoginService from '../service/LoginService.js'
import UserAccountService from "@/service/UserAccountService";
export default {
components: {ErrorBox},
@@ -41,10 +42,33 @@ export default {
handleLogin() {
LoginService.getToken(this.email, this.password).
then(ans => {
this.$store.commit('setToken', ans.data)
this.$store.commit('setLogin', this.email, this.password)
this.$store.commit('setMessage', '')
this.$store.commit('setToken', ans.data)
this.$store.commit('setLogin', this.email)
UserAccountService.getRolesForLoggedInUser(ans.data).then(roles => {
this.$store.commit('setActiveRoles', roles.data)
UserAccountService.getUserAccountDetails(this.email, ans.data).then(usr => {
this.$store.commit('setUserAccountDetails', usr.data)
}).catch(err =>{
console.log(err.response)
this.$store.commit('setLogin', '', '')
})
this.$router.push('/Subjects/student')
}).catch(err => {
if(err.response) {
this.error = err.response.data;
} else {
this.error = err
}
console.log(err.response)
this.$store.commit('setLogin', '', '')
})
})
.catch(err => {
if(err.response) {
Loading