Sha256: bf227f908bc67c59965b33211c4f52a99cfef2dfe95ea4c2195a54d2a279f4e2

Contents?: true

Size: 1.36 KB

Versions: 5

Compression:

Stored size: 1.36 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 useUsersRoles = defineStore("usersRoles", {
    state: () => {
        return {
            loading: false,
            pagination: {}, 
            records: []
        }
    },
    actions: {

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

        fetch() {
            this.loading = true
            this.http.get(this.url.audit("users/roles")).then(result => {
                this.records = result
            }).catch(error => {

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

    }
})

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lesli_audit-0.5.0 lib/vue/stores/users/roles.js
lesli_audit-0.4.0 lib/vue/stores/users/roles.js
lesli_audit-0.3.0 lib/vue/stores/users/roles.js
lesli_audit-0.2.0 lib/vue/stores/users/roles.js
lesli_audit-0.1.0 lib/vue/stores/users/roles.js