update
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import type { HttpContext } from '@adonisjs/core/http'
|
||||
import CustomField from '#base_modules/CustomField/model/custom_field'
|
||||
|
||||
export default class CustomFieldsController {
|
||||
/**
|
||||
* @summary List custom fields in the current tenant
|
||||
* @responseBody 200 - {"data":[]}
|
||||
* @responseBody 401 - {"message":"Unauthorized"}
|
||||
* @responseBody 400 - {"code":"E_TENANT_REQUIRED","message":"X-Tenant-Id header is required"}
|
||||
* @responseBody 403 - {"code":"E_TENANT_ACCESS_DENIED","message":"You do not have access to this tenant"}
|
||||
*/
|
||||
public async index({ response, tenant }: HttpContext) {
|
||||
const fields = await CustomField.query().where('tenant_id', tenant.id).orderBy('id', 'asc')
|
||||
return response.ok({ data: fields })
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user