This commit is contained in:
2026-09-02 09:19:43 +03:00
parent 74cb5b6176
commit 962f489142
34 changed files with 1190 additions and 124 deletions
@@ -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 })
}
}