Files
api.personalink/app/controllers/vtubers_controller.js
2026-05-13 11:50:22 +02:00

18 lines
730 B
JavaScript

import Profile from '#models/profile';
import Tag from '#models/tag';
export default class VtubersController {
async show({}) {
const profile = await Profile.firstOrFail();
const tags = await Tag.all();
return { ...profile.serialize(), tags: tags.map((t) => t.name) };
}
async update({ request }) {
const profile = await Profile.firstOrFail();
const data = request.only(['name', 'avatarUrl', 'backgroundImageUrl', 'title', 'description', 'aboutText']);
profile.merge(data);
await profile.save();
const tags = await Tag.all();
return { ...profile.serialize(), tags: tags.map((t) => t.name) };
}
}
//# sourceMappingURL=vtubers_controller.js.map