init project portal web
This commit is contained in:
12
lib/helper/option/index.ts
Normal file
12
lib/helper/option/index.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import { OptionProps } from "../type"
|
||||
|
||||
export const toOptionProps = (data: any): OptionProps[] => {
|
||||
if(!data) return []
|
||||
|
||||
return data.data.map((item: any) => {
|
||||
return {
|
||||
value: item.id,
|
||||
name: item.name
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user