Sh Frontend!
Documentation
Backend Docs
Github
Documentation
Backend Docs
Github
  • Guide

    • Introduction
  • Layouts

    • sh card layout
  • Components

    • ShModal
    • Sh modal Form
    • Sh Canvas
    • Confirmation Action
    • Routes
    • Sh Tabs
    • Sh Dynamic Tabs
    • Sh Form
    • Sh Table
  • Helpers

    • Helpers
    • shUser
    • shApi
    • shRepo
  • About

    • Overview
    • Team

shRepo

This contains common helper functions

Importing

import {shRepo} from '@iankibetsh/shframework'

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:: 6/27/25, 8:57 AM
Contributors: Hosea Kibet
Prev
shApi