<template>
  <h1>Other</h1>
</template>

<script>
  import AjaxErrorHandler from "../assets/js/errorHandler";
  export default {
    name: 'AdminSessionKiller',
    data () {
      return {
        username: '',
        loading: false,
        errors: {
          KillSession: ''
        }
      }
    },
    methods: {
      save () {
        this.errors.KillSession = ''

        if(!this.name.trim().length) {
          this.errors.username = 'Username can\'t be blank'
          return
        }

        this.loading = true
      },
      KillSessionOperation () {
        this.loading = true

        this.axios
          .post(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'admin/killsession/' + this.username)
          .then(res => {
            this.loading = false
            this.KillSession.push(res.data)
            this.$store.commit('KillSession', res.data)
          })
          .catch(AjaxErrorHandler(this.$store))
      },
    }
  }
</script>

<style lang='scss' scoped>
  @import '../assets/scss/variables.scss';

  .admin_forum_info {
    @at-root #{&}__label {
      display: flex;
      align-items: center;
      margin-bottom: 0.5rem;

      & > span {
        font-size: 0.9rem;
        margin-left: 0.5rem;
      }
    }
  }
</style>
