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 @@
@@ -13,7 +13,7 @@
<label for="password">Password:</label>
<label for="password">Password:</label>
<input type="password" id="password" required v-model="password">
<input type="password" id="password" required v-model="password">
<button type="submit" @click="handleLogin">Logg inn</button>
<button type="submit">Logg inn</button>
</form>
</form>
</div>
</div>
@@ -23,6 +23,7 @@
@@ -23,6 +23,7 @@
import ErrorBox from './ErrorBox.vue'
import ErrorBox from './ErrorBox.vue'
import LoginService from '../service/LoginService.js'
import LoginService from '../service/LoginService.js'
 
import UserAccountService from "@/service/UserAccountService";
export default {
export default {
components: {ErrorBox},
components: {ErrorBox},
@@ -41,10 +42,33 @@ export default {
@@ -41,10 +42,33 @@ export default {
handleLogin() {
handleLogin() {
LoginService.getToken(this.email, this.password).
LoginService.getToken(this.email, this.password).
then(ans => {
then(ans => {
this.$store.commit('setToken', ans.data)
this.$store.commit('setToken', ans.data)
this.$store.commit('setLogin', this.email, this.password)
this.$store.commit('setLogin', this.email)
this.$store.commit('setMessage', '')
 
 
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')
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 => {
.catch(err => {
if(err.response) {
if(err.response) {
Loading