shRepo

This contains common helper functions

Importing

import {shRepo} from '@silahkosgei/sfrontend'

Methods

runPlainRequest

Use to run doPost request but with a prompt for confirmation

shRepo.runPlainRequest('admin/departments/department/delete-department/1').then((res) => {
    if (res.isConfirmed) {
      // success
    }
  })

runSilentRequest

Use to run doPost request WITHOUT prompt for confirmation

shRepo.runSilentRequest('admin/departments/department/delete-department/1').then((res) => {
    if (res.isConfirmed) {
      // success
    }
  })

showToast

shows a toast message

shRepo.showToast('module added successfully', 'success')

Takes the message and type in the case above a success

swalError

Triggers a sweet alert popup with error

swalSuccess

Triggers a sweet alert popup with success

Last Updated:
Contributors: silah