Default is an actual category now

This commit is contained in:
Aria Moradi
2021-08-21 03:46:01 +04:30
parent c1f43157d9
commit 7a4bc28669
2 changed files with 17 additions and 34 deletions

View File

@@ -48,6 +48,7 @@ export default function CategorySelect(props: IProps) {
client.get('/api/v1/category/')
.then((response) => response.data)
.then((data: ICategory[]) => {
if (data.length > 0 && data[0].name === 'Default') { data.shift(); }
tmpCategoryInfos = data.map((category) => ({ category, selected: false }));
})
.then(() => {