|
@@ -9,8 +9,16 @@ export function getUserData () {
|
|
|
export function setUserData (data) {
|
|
|
localStorage.setItem(UserIdKey,JSON.stringify(data))
|
|
|
}
|
|
|
-export function getTyps () {
|
|
|
- return JSON.parse(localStorage.getItem(TypesKey));
|
|
|
+export function getTyps (id) {
|
|
|
+ if(id){
|
|
|
+ var arr=JSON.parse(localStorage.getItem(TypesKey));
|
|
|
+ var item=arr.filter(element => {
|
|
|
+ return typeof(id)=='string'?element.code==id:element.id==id
|
|
|
+ });
|
|
|
+ return item[0]
|
|
|
+ }else{
|
|
|
+ return JSON.parse(localStorage.getItem(TypesKey));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
export function setTyps (data) {
|