Commit 3bce7d37 authored by Jean-Baptiste Oellers's avatar Jean-Baptiste Oellers
Browse files

Fix: bouton Nouvelle Discipline redmine #65841

parent e8b428a0
Loading
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@
  </Modal>
  <nav>
    <input type="search" v-model="searched" class="form-control input-lg" placeholder="Rechercher une discipline" />
    <button class="btn btn-primary">
    <button class="btn btn-primary" @click="handlerCreateItem()">
      Nouvelle discipline
    </button>
  </nav>
@@ -74,6 +74,9 @@ let filtered = computed(()=> {
});

// HANDLERS
function handlerCreateItem() {
  edited.value = JSON.parse('{"label":"","active":true,"usage":0}');
}
function handlerDeleteItem(item) {

}
@@ -88,9 +91,15 @@ function handlerEditItem(item) {

function handlerSave() {
  let dt = JSON.parse(JSON.stringify(edited.value));
  if (dt.id) {
    AxiosOscar.put(props.url, dt).then((response) => {
      handlerFetch()
    })
  } else {
    AxiosOscar.post(props.url, dt).then((response) => {
      handlerFetch()
    })
  }
}

function handlerToggleUse(item) {