22 lines
716 B
JavaScript
22 lines
716 B
JavaScript
import BrandColor from '#models/brand_color';
|
|
import BrandFont from '#models/brand_font';
|
|
export default class BrandsController {
|
|
async show({}) {
|
|
const colors = await BrandColor.all();
|
|
const fonts = await BrandFont.all();
|
|
return { colors, fonts };
|
|
}
|
|
async update({ request }) {
|
|
const { colors, fonts } = request.only(['colors', 'fonts']);
|
|
if (colors) {
|
|
await BrandColor.truncate();
|
|
await BrandColor.createMany(colors);
|
|
}
|
|
if (fonts) {
|
|
await BrandFont.truncate();
|
|
await BrandFont.createMany(fonts);
|
|
}
|
|
return this.show({ request });
|
|
}
|
|
}
|
|
//# sourceMappingURL=brands_controller.js.map
|