{"size": 1638, "ext": "js", "max_stars_repo_path": "resources/assets/js/common.js", "max_stars_repo_name": "nazmul-7/Dream_Gallery_Modified", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "resources/assets/js/common.js", "max_issues_repo_name": "nazmul-7/Dream_Gallery_Modified", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "resources/assets/js/common.js", "max_forks_repo_name": "nazmul-7/Dream_Gallery_Modified", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 15.308411215, "max_line_length": 61, "alphanum_fraction": 0.427960928}
import {mapActions,mapGetters} from 'vuex';
export default {
	data(){
		return {
			productStock:null,
			authUser : window.authUser,
		}
	},

	methods: {
		//  A COMMON WAY TO CALL THE APIS USING ASYNC AWAIT 
		async callApi(method, url, dataObj){
			try{
	  
				let data = await axios({
					method: method,
					url: url,
					data: dataObj
				})
				return data 
				
			}catch(e){
				
				return e.response
			}
		},
	  



		async getStock(id)
		{	
			
			try{
			let {data} =await axios({
				method: 'get',
				url:`/app/getStock/${id}`,
				})
				
				this.lf()
				this.productStock=data.data
				
				

			}catch(e){
				this.e('Oops!','Something went wrong, please try again!')
				this.le()
				return 0
			}
		},
		ls()
		{
			this.$Loading.start();
		},
		lf()
		{
			this.$Loading.finish();
		},
		le()
		{
			this.$Loading.error();
		},
		i(t,m){
			this.$Notice.info({
                title: t,
                desc: m
            });
		},
		e(t,m){
			this.$Notice.error({
                title: t,
                desc: m
            });
		},
		s(t,m){
			this.$Notice.success({
                title: t,
                desc: m
            });
		},
		w(t,m){
			this.$Notice.warning({
                title: t,
                desc: m
            });
		},
		swr(m){
			this.$Notice.error({
                title: 'Oops',
                desc: `Something went wrong with ${m}`
            });
		},
		ss(m,t="Great!"){
			this.$Notice.success({
                title: t,
                desc: m
            });
		}


	},
	computed: {
        ...mapGetters({
            headerName: 'getHeader',
        }),
    },
}