mirror of
https://github.com/pheralb/svgl.git
synced 2024-11-13 08:46:56 +08:00
14 lines
360 B
JavaScript
14 lines
360 B
JavaScript
|
import db from "data/icons";
|
||
|
|
||
|
// 📦 Show categories ->
|
||
|
export default function handler(req, res) {
|
||
|
try {
|
||
|
const categories = db
|
||
|
.map((item) => item.category)
|
||
|
.filter((category, index, self) => self.indexOf(category) === index);
|
||
|
return res.status(200).json(categories);
|
||
|
} catch (err) {
|
||
|
res.status(400).json({ message: err });
|
||
|
}
|
||
|
}
|