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.
|
|
const initialState = { |
|
|
loading: false, |
|
|
error: null, |
|
|
list: [ |
|
|
{ |
|
|
type: "voice", |
|
|
title: "استاد رضایی:توضیح در مورد درس آتشفشان", |
|
|
file: null, |
|
|
}, |
|
|
{ |
|
|
type: "video", |
|
|
title: "ویدئوی آزمایشی آتش فشان سرکه", |
|
|
file: null, |
|
|
}, |
|
|
{ |
|
|
type: "ppt", |
|
|
title: "فایل پاورپوینت ارائه درس آتشفشان", |
|
|
link: "", |
|
|
}, |
|
|
{ |
|
|
type: "pdf", |
|
|
title: "فایل پی دی اف ارائه درس آتشفشان", |
|
|
link: "", |
|
|
}, |
|
|
{ |
|
|
type: "links", |
|
|
links: [ |
|
|
{ |
|
|
title: "وبسایت آموزشی دانوین", |
|
|
link: "", |
|
|
}, |
|
|
{ |
|
|
title: "وبسایت رسمی مدیریت راهبردی کشور", |
|
|
link: "", |
|
|
}, |
|
|
{ |
|
|
title: "سازمان تبلیغات صنایع سبک", |
|
|
link: "", |
|
|
}, |
|
|
], |
|
|
}, |
|
|
], |
|
|
}; |
|
|
export default function qr(state = initialState, action) { |
|
|
let { type, data } = action; |
|
|
switch (type) { |
|
|
case "qr/list": |
|
|
return { ...state, loading: false, error: null }; |
|
|
case "qr/update": |
|
|
return { ...state, loading: false, error: null }; |
|
|
case "qr/add": |
|
|
return { ...state, loading: false, error: null }; |
|
|
case "qr/delete": |
|
|
return { ...state, loading: false, error: null }; |
|
|
case "qr/info": |
|
|
return { |
|
|
...state, |
|
|
loading: false, |
|
|
list: action.payload === "Zist10-13" ? [] : null, |
|
|
error: null, |
|
|
}; |
|
|
///////////// |
|
|
case "loading": |
|
|
return { ...state, loading: true }; |
|
|
case "error": |
|
|
return { ...state, loading: false, error: data.message }; |
|
|
default: |
|
|
return state; |
|
|
} |
|
|
}
|
|
|
|