Sha256: 90954dd10386daee89d32090de59c8f4e16d9061b381a009e4f619534757fbe7

Contents?: true

Size: 1.85 KB

Versions: 2

Compression:

Stored size: 1.85 KB

Contents

/*
Copyright (c) 2022, all rights reserved.

All the information provided by this platform is protected by international laws related  to 
industrial property, intellectual property, copyright and relative international laws. 
All intellectual or industrial property rights of the code, texts, trade mark, design, 
pictures and any other information belongs to the owner of this platform.

Without the written permission of the owner, any replication, modification,
transmission, publication is strictly forbidden.

For more information read the license file including with this software.

// · ~·~     ~·~     ~·~     ~·~     ~·~     ~·~     ~·~     ~·~     ~·~     ~·~     ~·~     ~·~
// · 
*/


// · 
import { defineStore } from "pinia"


// · 
export const useRequests = defineStore("Requests", {
    state: () => {
        return {
            date: "",
            loading: false,
            pagination: {}, 
            records: []
        }
    },
    actions: {

        search(string) {
            console.log(string)
            this.fetchLogs(this.url.audit("requests").search(string), false)
        },

        sort(column, direction) {
            this.fetchLogs(this.url.audit("requests").order(column, direction), false)
        },

        paginate(page) {
            this.fetchLogs(this.url.audit("requests").paginate(page), false)
        },

        fetch() {
            if (this.records.length <= 0) {
                this.getRequests()
            }
        },

        getRequests(url=this.url.audit("requests"), loading=true) {

            this.loading = loading

            this.http.get(url).then(result => {
                this.records = result.records
                this.pagination = result.pagination
            }).catch(error => {

            }).finally(() => {
                this.loading = false
            })

        }

    }
})

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lesli_audit-0.5.0 lib/vue/stores/request.js
lesli_audit-0.4.0 lib/vue/stores/request.js