ATlast — you'll never need to find your favorites on another platform again. Find your favs in the ATmosphere.
atproto
17
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add stock user_preference model, factory, and controller

byarielm.fyi 53457b73 a943cc12

verified
+68
+38
app/controllers/user_preferences_controller.ts
··· 1 + import type { HttpContext } from '@adonisjs/core/http' 2 + 3 + export default class UserPreferencesController { 4 + /** 5 + * Display a list of resource 6 + */ 7 + async index({}: HttpContext) {} 8 + 9 + /** 10 + * Display form to create a new record 11 + */ 12 + async create({}: HttpContext) {} 13 + 14 + /** 15 + * Handle form submission for the create action 16 + */ 17 + async store({ request }: HttpContext) {} 18 + 19 + /** 20 + * Show individual record 21 + */ 22 + async show({ params }: HttpContext) {} 23 + 24 + /** 25 + * Edit individual record 26 + */ 27 + async edit({ params }: HttpContext) {} 28 + 29 + /** 30 + * Handle form submission for the edit action 31 + */ 32 + async update({ params, request }: HttpContext) {} 33 + 34 + /** 35 + * Delete record 36 + */ 37 + async destroy({ params }: HttpContext) {} 38 + }
+4
app/models/user_preference.ts
··· 1 + import { UserPreferenceSchema } from '#database/schema' 2 + 3 + export default class UserPreference extends UserPreferenceSchema { 4 + }
+8
database/factories/user_preference_factory.ts
··· 1 + import factory from '@adonisjs/lucid/factories' 2 + import UserPreference from '#models/user_preference' 3 + 4 + export const UserPreferenceFactory = factory 5 + .define(UserPreference, async ({ faker }) => { 6 + return {} 7 + }) 8 + .build()
+18
database/migrations/1773627698421_create_user_preferences_table.ts
··· 1 + import { BaseSchema } from '@adonisjs/lucid/schema' 2 + 3 + export default class extends BaseSchema { 4 + protected tableName = 'user_preferences' 5 + 6 + async up() { 7 + this.schema.createTable(this.tableName, (table) => { 8 + table.increments('id') 9 + 10 + table.timestamp('created_at') 11 + table.timestamp('updated_at') 12 + }) 13 + } 14 + 15 + async down() { 16 + this.schema.dropTable(this.tableName) 17 + } 18 + }