You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.5 KiB
67 lines
1.5 KiB
6 months ago
|
import { createSlice, createAsyncThunk } from '@reduxjs/toolkit'
|
||
|
import jquery from 'jquery'
|
||
|
|
||
|
export const getStatusSPT = createAsyncThunk('peta/getStatusSPT', async () => {
|
||
|
const response = await jquery.get(`/engineN/kewilayahan/ref/statusspt`)
|
||
|
return response
|
||
|
})
|
||
|
|
||
|
export const petaSlice = createSlice({
|
||
|
name: 'peta',
|
||
|
initialState: {
|
||
|
selectedOpsi: null,
|
||
|
user: {},
|
||
|
warnaBayar: {
|
||
|
black: {
|
||
|
wb: 'black',
|
||
|
info: 'di bawah Rp0',
|
||
|
warna: '#202020'
|
||
|
},
|
||
|
BLACK: {
|
||
|
wb: 'BLACK',
|
||
|
info: 'Rp0',
|
||
|
warna: '#685f62'
|
||
|
},
|
||
|
red: {
|
||
|
wb: 'red',
|
||
|
info: 'di bawah 5juta',
|
||
|
warna: '#ff0000'
|
||
|
},
|
||
|
yellow: {
|
||
|
wb: 'yellow',
|
||
|
info: '5 jt s.d. 48 jt',
|
||
|
warna: '#aba210'
|
||
|
},
|
||
|
green: {
|
||
|
wb: 'green',
|
||
|
info: '48 jt s.d. 100 jt',
|
||
|
warna: '#00a800'
|
||
|
},
|
||
|
blue: {
|
||
|
wb: 'blue',
|
||
|
info: 'di atas 100 jt',
|
||
|
warna: '#0000e1'
|
||
|
}
|
||
|
},
|
||
|
statusSPT: {},
|
||
|
cqlFilterWilayah: '(1=1)'
|
||
|
},
|
||
|
reducers: {
|
||
|
setSelectedOpsi: (state, action) => {
|
||
|
state.selectedOpsi = action.payload
|
||
|
},
|
||
|
setCqlFilterWilayah: (state, action) => {
|
||
|
state.cqlFilterWilayah = action.payload
|
||
|
}
|
||
|
},
|
||
|
extraReducers: (builder) => {
|
||
|
builder.addCase(getStatusSPT.fulfilled, (state, action) => {
|
||
|
state.statusSPT = action.payload
|
||
|
})
|
||
|
}
|
||
|
})
|
||
|
|
||
|
export const { setSelectedOpsi, setDataMonitoring, setDataUrut, setCqlFilterWilayah } = petaSlice.actions
|
||
|
|
||
|
export default petaSlice.reducer
|