@ -32,7 +32,7 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// Add a schema field.
/// Add a schema field.
/// </summary>
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name ">The name of the schema.</param>
/// <param name="schema ">The name of the schema.</param>
/// <param name="request">The field object that needs to be added to the schema.</param>
/// <param name="request">The field object that needs to be added to the schema.</param>
/// <returns>
/// <returns>
/// 201 => Schema field created.
/// 201 => Schema field created.
@ -41,24 +41,24 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// 409 => Schema field name already in use.
/// 409 => Schema field name already in use.
/// </returns>
/// </returns>
[HttpPost]
[HttpPost]
[Route("apps/{app}/schemas/{name }/fields/")]
[Route("apps/{app}/schemas/{schema }/fields/")]
[ProducesResponseType(typeof(SchemaDto), 201)]
[ProducesResponseType(typeof(SchemaDto), 201)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiCosts(1)]
[ApiCosts(1)]
public async Task < IActionResult > PostField ( string app , string name , [ FromBody ] AddFieldDto request )
public async Task < IActionResult > PostField ( string app , string schema , [ FromBody ] AddFieldDto request )
{
{
var command = request . ToCommand ( ) ;
var command = request . ToCommand ( ) ;
var response = await InvokeCommandAsync ( command ) ;
var response = await InvokeCommandAsync ( command ) ;
return CreatedAtAction ( nameof ( SchemasController . GetSchema ) , "Schemas" , new { app , name } , response ) ;
return CreatedAtAction ( nameof ( SchemasController . GetSchema ) , "Schemas" , new { app , schema } , response ) ;
}
}
/// <summary>
/// <summary>
/// Add a nested field.
/// Add a nested field.
/// </summary>
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name ">The name of the schema.</param>
/// <param name="schema ">The name of the schema.</param>
/// <param name="parentId">The parent field id.</param>
/// <param name="parentId">The parent field id.</param>
/// <param name="request">The field object that needs to be added to the schema.</param>
/// <param name="request">The field object that needs to be added to the schema.</param>
/// <returns>
/// <returns>
@ -68,24 +68,24 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// 404 => Schema, field or app not found.
/// 404 => Schema, field or app not found.
/// </returns>
/// </returns>
[HttpPost]
[HttpPost]
[Route("apps/{app}/schemas/{name }/fields/{parentId:long}/nested/")]
[Route("apps/{app}/schemas/{schema }/fields/{parentId:long}/nested/")]
[ProducesResponseType(typeof(SchemaDto), 201)]
[ProducesResponseType(typeof(SchemaDto), 201)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiCosts(1)]
[ApiCosts(1)]
public async Task < IActionResult > PostNestedField ( string app , string name , long parentId , [ FromBody ] AddFieldDto request )
public async Task < IActionResult > PostNestedField ( string app , string schema , long parentId , [ FromBody ] AddFieldDto request )
{
{
var command = request . ToCommand ( parentId ) ;
var command = request . ToCommand ( parentId ) ;
var response = await InvokeCommandAsync ( command ) ;
var response = await InvokeCommandAsync ( command ) ;
return CreatedAtAction ( nameof ( SchemasController . GetSchema ) , "Schemas" , new { app , name } , response ) ;
return CreatedAtAction ( nameof ( SchemasController . GetSchema ) , "Schemas" , new { app , schema } , response ) ;
}
}
/// <summary>
/// <summary>
/// Configure UI fields.
/// Configure UI fields.
/// </summary>
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name ">The name of the schema.</param>
/// <param name="schema ">The name of the schema.</param>
/// <param name="request">The request that contains the field names.</param>
/// <param name="request">The request that contains the field names.</param>
/// <returns>
/// <returns>
/// 200 => Schema UI fields defined.
/// 200 => Schema UI fields defined.
@ -93,11 +93,11 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// 404 => Schema or app not found.
/// 404 => Schema or app not found.
/// </returns>
/// </returns>
[HttpPut]
[HttpPut]
[Route("apps/{app}/schemas/{name }/fields/ui/")]
[Route("apps/{app}/schemas/{schema }/fields/ui/")]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiCosts(1)]
[ApiCosts(1)]
public async Task < IActionResult > PutSchemaUIFields ( string app , string name , [ FromBody ] ConfigureUIFieldsDto request )
public async Task < IActionResult > PutSchemaUIFields ( string app , string schema , [ FromBody ] ConfigureUIFieldsDto request )
{
{
var command = request . ToCommand ( ) ;
var command = request . ToCommand ( ) ;
@ -110,7 +110,7 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// Reorder all fields.
/// Reorder all fields.
/// </summary>
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name ">The name of the schema.</param>
/// <param name="schema ">The name of the schema.</param>
/// <param name="request">The request that contains the field ids.</param>
/// <param name="request">The request that contains the field ids.</param>
/// <returns>
/// <returns>
/// 200 => Schema fields reordered.
/// 200 => Schema fields reordered.
@ -118,11 +118,11 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// 404 => Schema or app not found.
/// 404 => Schema or app not found.
/// </returns>
/// </returns>
[HttpPut]
[HttpPut]
[Route("apps/{app}/schemas/{name }/fields/ordering/")]
[Route("apps/{app}/schemas/{schema }/fields/ordering/")]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiCosts(1)]
[ApiCosts(1)]
public async Task < IActionResult > PutSchemaFieldOrdering ( string app , string name , [ FromBody ] ReorderFieldsDto request )
public async Task < IActionResult > PutSchemaFieldOrdering ( string app , string schema , [ FromBody ] ReorderFieldsDto request )
{
{
var command = request . ToCommand ( ) ;
var command = request . ToCommand ( ) ;
@ -135,7 +135,7 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// Reorder all nested fields.
/// Reorder all nested fields.
/// </summary>
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name ">The name of the schema.</param>
/// <param name="schema ">The name of the schema.</param>
/// <param name="parentId">The parent field id.</param>
/// <param name="parentId">The parent field id.</param>
/// <param name="request">The request that contains the field ids.</param>
/// <param name="request">The request that contains the field ids.</param>
/// <returns>
/// <returns>
@ -144,11 +144,11 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// 404 => Schema, field or app not found.
/// 404 => Schema, field or app not found.
/// </returns>
/// </returns>
[HttpPut]
[HttpPut]
[Route("apps/{app}/schemas/{name }/fields/{parentId:long}/nested/ordering/")]
[Route("apps/{app}/schemas/{schema }/fields/{parentId:long}/nested/ordering/")]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiCosts(1)]
[ApiCosts(1)]
public async Task < IActionResult > PutNestedFieldOrdering ( string app , string name , long parentId , [ FromBody ] ReorderFieldsDto request )
public async Task < IActionResult > PutNestedFieldOrdering ( string app , string schema , long parentId , [ FromBody ] ReorderFieldsDto request )
{
{
var command = request . ToCommand ( parentId ) ;
var command = request . ToCommand ( parentId ) ;
@ -161,7 +161,7 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// Update a schema field.
/// Update a schema field.
/// </summary>
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name ">The name of the schema.</param>
/// <param name="schema ">The name of the schema.</param>
/// <param name="id">The id of the field to update.</param>
/// <param name="id">The id of the field to update.</param>
/// <param name="request">The field object that needs to be added to the schema.</param>
/// <param name="request">The field object that needs to be added to the schema.</param>
/// <returns>
/// <returns>
@ -170,11 +170,11 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// 404 => Schema, field or app not found.
/// 404 => Schema, field or app not found.
/// </returns>
/// </returns>
[HttpPut]
[HttpPut]
[Route("apps/{app}/schemas/{name }/fields/{id:long}/")]
[Route("apps/{app}/schemas/{schema }/fields/{id:long}/")]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiCosts(1)]
[ApiCosts(1)]
public async Task < IActionResult > PutField ( string app , string name , long id , [ FromBody ] UpdateFieldDto request )
public async Task < IActionResult > PutField ( string app , string schema , long id , [ FromBody ] UpdateFieldDto request )
{
{
var command = request . ToCommand ( id ) ;
var command = request . ToCommand ( id ) ;
@ -187,7 +187,7 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// Update a nested field.
/// Update a nested field.
/// </summary>
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name ">The name of the schema.</param>
/// <param name="schema ">The name of the schema.</param>
/// <param name="parentId">The parent field id.</param>
/// <param name="parentId">The parent field id.</param>
/// <param name="id">The id of the field to update.</param>
/// <param name="id">The id of the field to update.</param>
/// <param name="request">The field object that needs to be added to the schema.</param>
/// <param name="request">The field object that needs to be added to the schema.</param>
@ -197,11 +197,11 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// 404 => Schema, field or app not found.
/// 404 => Schema, field or app not found.
/// </returns>
/// </returns>
[HttpPut]
[HttpPut]
[Route("apps/{app}/schemas/{name }/fields/{parentId:long}/nested/{id:long}/")]
[Route("apps/{app}/schemas/{schema }/fields/{parentId:long}/nested/{id:long}/")]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiCosts(1)]
[ApiCosts(1)]
public async Task < IActionResult > PutNestedField ( string app , string name , long parentId , long id , [ FromBody ] UpdateFieldDto request )
public async Task < IActionResult > PutNestedField ( string app , string schema , long parentId , long id , [ FromBody ] UpdateFieldDto request )
{
{
var command = request . ToCommand ( id , parentId ) ;
var command = request . ToCommand ( id , parentId ) ;
@ -214,7 +214,7 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// Lock a schema field.
/// Lock a schema field.
/// </summary>
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name ">The name of the schema.</param>
/// <param name="schema ">The name of the schema.</param>
/// <param name="id">The id of the field to lock.</param>
/// <param name="id">The id of the field to lock.</param>
/// <returns>
/// <returns>
/// 200 => Schema field shown.
/// 200 => Schema field shown.
@ -225,11 +225,11 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// A locked field cannot be updated or deleted.
/// A locked field cannot be updated or deleted.
/// </remarks>
/// </remarks>
[HttpPut]
[HttpPut]
[Route("apps/{app}/schemas/{name }/fields/{id:long}/lock/")]
[Route("apps/{app}/schemas/{schema }/fields/{id:long}/lock/")]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiCosts(1)]
[ApiCosts(1)]
public async Task < IActionResult > LockField ( string app , string name , long id )
public async Task < IActionResult > LockField ( string app , string schema , long id )
{
{
var command = new LockField { FieldId = id } ;
var command = new LockField { FieldId = id } ;
@ -242,7 +242,7 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// Lock a nested field.
/// Lock a nested field.
/// </summary>
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name ">The name of the schema.</param>
/// <param name="schema ">The name of the schema.</param>
/// <param name="parentId">The parent field id.</param>
/// <param name="parentId">The parent field id.</param>
/// <param name="id">The id of the field to lock.</param>
/// <param name="id">The id of the field to lock.</param>
/// <returns>
/// <returns>
@ -254,11 +254,11 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// A locked field cannot be edited or deleted.
/// A locked field cannot be edited or deleted.
/// </remarks>
/// </remarks>
[HttpPut]
[HttpPut]
[Route("apps/{app}/schemas/{name }/fields/{parentId:long}/nested/{id:long}/lock/")]
[Route("apps/{app}/schemas/{schema }/fields/{parentId:long}/nested/{id:long}/lock/")]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiCosts(1)]
[ApiCosts(1)]
public async Task < IActionResult > LockNestedField ( string app , string name , long parentId , long id )
public async Task < IActionResult > LockNestedField ( string app , string schema , long parentId , long id )
{
{
var command = new LockField { ParentFieldId = parentId , FieldId = id } ;
var command = new LockField { ParentFieldId = parentId , FieldId = id } ;
@ -271,7 +271,7 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// Hide a schema field.
/// Hide a schema field.
/// </summary>
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name ">The name of the schema.</param>
/// <param name="schema ">The name of the schema.</param>
/// <param name="id">The id of the field to hide.</param>
/// <param name="id">The id of the field to hide.</param>
/// <returns>
/// <returns>
/// 200 => Schema field hidden.
/// 200 => Schema field hidden.
@ -282,11 +282,11 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// A hidden field is not part of the API response, but can still be edited in the portal.
/// A hidden field is not part of the API response, but can still be edited in the portal.
/// </remarks>
/// </remarks>
[HttpPut]
[HttpPut]
[Route("apps/{app}/schemas/{name }/fields/{id:long}/hide/")]
[Route("apps/{app}/schemas/{schema }/fields/{id:long}/hide/")]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiCosts(1)]
[ApiCosts(1)]
public async Task < IActionResult > HideField ( string app , string name , long id )
public async Task < IActionResult > HideField ( string app , string schema , long id )
{
{
var command = new HideField { FieldId = id } ;
var command = new HideField { FieldId = id } ;
@ -299,7 +299,7 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// Hide a nested field.
/// Hide a nested field.
/// </summary>
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name ">The name of the schema.</param>
/// <param name="schema ">The name of the schema.</param>
/// <param name="parentId">The parent field id.</param>
/// <param name="parentId">The parent field id.</param>
/// <param name="id">The id of the field to hide.</param>
/// <param name="id">The id of the field to hide.</param>
/// <returns>
/// <returns>
@ -311,11 +311,11 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// A hidden field is not part of the API response, but can still be edited in the portal.
/// A hidden field is not part of the API response, but can still be edited in the portal.
/// </remarks>
/// </remarks>
[HttpPut]
[HttpPut]
[Route("apps/{app}/schemas/{name }/fields/{parentId:long}/nested/{id:long}/hide/")]
[Route("apps/{app}/schemas/{schema }/fields/{parentId:long}/nested/{id:long}/hide/")]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiCosts(1)]
[ApiCosts(1)]
public async Task < IActionResult > HideNestedField ( string app , string name , long parentId , long id )
public async Task < IActionResult > HideNestedField ( string app , string schema , long parentId , long id )
{
{
var command = new HideField { ParentFieldId = parentId , FieldId = id } ;
var command = new HideField { ParentFieldId = parentId , FieldId = id } ;
@ -328,7 +328,7 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// Show a schema field.
/// Show a schema field.
/// </summary>
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name ">The name of the schema.</param>
/// <param name="schema ">The name of the schema.</param>
/// <param name="id">The id of the field to show.</param>
/// <param name="id">The id of the field to show.</param>
/// <returns>
/// <returns>
/// 200 => Schema field shown.
/// 200 => Schema field shown.
@ -339,11 +339,11 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// A hidden field is not part of the API response, but can still be edited in the portal.
/// A hidden field is not part of the API response, but can still be edited in the portal.
/// </remarks>
/// </remarks>
[HttpPut]
[HttpPut]
[Route("apps/{app}/schemas/{name }/fields/{id:long}/show/")]
[Route("apps/{app}/schemas/{schema }/fields/{id:long}/show/")]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiCosts(1)]
[ApiCosts(1)]
public async Task < IActionResult > ShowField ( string app , string name , long id )
public async Task < IActionResult > ShowField ( string app , string schema , long id )
{
{
var command = new ShowField { FieldId = id } ;
var command = new ShowField { FieldId = id } ;
@ -356,7 +356,7 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// Show a nested field.
/// Show a nested field.
/// </summary>
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name ">The name of the schema.</param>
/// <param name="schema ">The name of the schema.</param>
/// <param name="parentId">The parent field id.</param>
/// <param name="parentId">The parent field id.</param>
/// <param name="id">The id of the field to show.</param>
/// <param name="id">The id of the field to show.</param>
/// <returns>
/// <returns>
@ -368,11 +368,11 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// A hidden field is not part of the API response, but can still be edited in the portal.
/// A hidden field is not part of the API response, but can still be edited in the portal.
/// </remarks>
/// </remarks>
[HttpPut]
[HttpPut]
[Route("apps/{app}/schemas/{name }/fields/{parentId:long}/nested/{id:long}/show/")]
[Route("apps/{app}/schemas/{schema }/fields/{parentId:long}/nested/{id:long}/show/")]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiCosts(1)]
[ApiCosts(1)]
public async Task < IActionResult > ShowNestedField ( string app , string name , long parentId , long id )
public async Task < IActionResult > ShowNestedField ( string app , string schema , long parentId , long id )
{
{
var command = new ShowField { ParentFieldId = parentId , FieldId = id } ;
var command = new ShowField { ParentFieldId = parentId , FieldId = id } ;
@ -385,7 +385,7 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// Enable a schema field.
/// Enable a schema field.
/// </summary>
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name ">The name of the schema.</param>
/// <param name="schema ">The name of the schema.</param>
/// <param name="id">The id of the field to enable.</param>
/// <param name="id">The id of the field to enable.</param>
/// <returns>
/// <returns>
/// 200 => Schema field enabled.
/// 200 => Schema field enabled.
@ -396,11 +396,11 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// A disabled field cannot not be edited in the squidex portal anymore, but will be part of the API response.
/// A disabled field cannot not be edited in the squidex portal anymore, but will be part of the API response.
/// </remarks>
/// </remarks>
[HttpPut]
[HttpPut]
[Route("apps/{app}/schemas/{name }/fields/{id:long}/enable/")]
[Route("apps/{app}/schemas/{schema }/fields/{id:long}/enable/")]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiCosts(1)]
[ApiCosts(1)]
public async Task < IActionResult > EnableField ( string app , string name , long id )
public async Task < IActionResult > EnableField ( string app , string schema , long id )
{
{
var command = new EnableField { FieldId = id } ;
var command = new EnableField { FieldId = id } ;
@ -413,7 +413,7 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// Enable a nested field.
/// Enable a nested field.
/// </summary>
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name ">The name of the schema.</param>
/// <param name="schema ">The name of the schema.</param>
/// <param name="parentId">The parent field id.</param>
/// <param name="parentId">The parent field id.</param>
/// <param name="id">The id of the field to enable.</param>
/// <param name="id">The id of the field to enable.</param>
/// <returns>
/// <returns>
@ -425,11 +425,11 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// A disabled field cannot not be edited in the squidex portal anymore, but will be part of the API response.
/// A disabled field cannot not be edited in the squidex portal anymore, but will be part of the API response.
/// </remarks>
/// </remarks>
[HttpPut]
[HttpPut]
[Route("apps/{app}/schemas/{name }/fields/{parentId:long}/nested/{id:long}/enable/")]
[Route("apps/{app}/schemas/{schema }/fields/{parentId:long}/nested/{id:long}/enable/")]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiCosts(1)]
[ApiCosts(1)]
public async Task < IActionResult > EnableNestedField ( string app , string name , long parentId , long id )
public async Task < IActionResult > EnableNestedField ( string app , string schema , long parentId , long id )
{
{
var command = new EnableField { ParentFieldId = parentId , FieldId = id } ;
var command = new EnableField { ParentFieldId = parentId , FieldId = id } ;
@ -442,7 +442,7 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// Disable a schema field.
/// Disable a schema field.
/// </summary>
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name ">The name of the schema.</param>
/// <param name="schema ">The name of the schema.</param>
/// <param name="id">The id of the field to disable.</param>
/// <param name="id">The id of the field to disable.</param>
/// <returns>
/// <returns>
/// 200 => Schema field disabled.
/// 200 => Schema field disabled.
@ -453,11 +453,11 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// A disabled field cannot not be edited in the squidex portal anymore, but will be part of the API response.
/// A disabled field cannot not be edited in the squidex portal anymore, but will be part of the API response.
/// </remarks>
/// </remarks>
[HttpPut]
[HttpPut]
[Route("apps/{app}/schemas/{name }/fields/{id:long}/disable/")]
[Route("apps/{app}/schemas/{schema }/fields/{id:long}/disable/")]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiCosts(1)]
[ApiCosts(1)]
public async Task < IActionResult > DisableField ( string app , string name , long id )
public async Task < IActionResult > DisableField ( string app , string schema , long id )
{
{
var command = new DisableField { FieldId = id } ;
var command = new DisableField { FieldId = id } ;
@ -470,7 +470,7 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// Disable a nested field.
/// Disable a nested field.
/// </summary>
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name ">The name of the schema.</param>
/// <param name="schema ">The name of the schema.</param>
/// <param name="parentId">The parent field id.</param>
/// <param name="parentId">The parent field id.</param>
/// <param name="id">The id of the field to disable.</param>
/// <param name="id">The id of the field to disable.</param>
/// <returns>
/// <returns>
@ -482,11 +482,11 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// A disabled field cannot not be edited in the squidex portal anymore, but will be part of the API response.
/// A disabled field cannot not be edited in the squidex portal anymore, but will be part of the API response.
/// </remarks>
/// </remarks>
[HttpPut]
[HttpPut]
[Route("apps/{app}/schemas/{name }/fields/{parentId:long}/nested/{id:long}/disable/")]
[Route("apps/{app}/schemas/{schema }/fields/{parentId:long}/nested/{id:long}/disable/")]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiCosts(1)]
[ApiCosts(1)]
public async Task < IActionResult > DisableNestedField ( string app , string name , long parentId , long id )
public async Task < IActionResult > DisableNestedField ( string app , string schema , long parentId , long id )
{
{
var command = new DisableField { ParentFieldId = parentId , FieldId = id } ;
var command = new DisableField { ParentFieldId = parentId , FieldId = id } ;
@ -499,7 +499,7 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// Delete a schema field.
/// Delete a schema field.
/// </summary>
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name ">The name of the schema.</param>
/// <param name="schema ">The name of the schema.</param>
/// <param name="id">The id of the field to disable.</param>
/// <param name="id">The id of the field to disable.</param>
/// <returns>
/// <returns>
/// 200 => Schema field deleted.
/// 200 => Schema field deleted.
@ -507,11 +507,11 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// 404 => Schema, field or app not found.
/// 404 => Schema, field or app not found.
/// </returns>
/// </returns>
[HttpDelete]
[HttpDelete]
[Route("apps/{app}/schemas/{name }/fields/{id:long}/")]
[Route("apps/{app}/schemas/{schema }/fields/{id:long}/")]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiCosts(1)]
[ApiCosts(1)]
public async Task < IActionResult > DeleteField ( string app , string name , long id )
public async Task < IActionResult > DeleteField ( string app , string schema , long id )
{
{
var command = new DeleteField { FieldId = id } ;
var command = new DeleteField { FieldId = id } ;
@ -524,7 +524,7 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// Delete a nested field.
/// Delete a nested field.
/// </summary>
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name ">The name of the schema.</param>
/// <param name="schema ">The name of the schema.</param>
/// <param name="parentId">The parent field id.</param>
/// <param name="parentId">The parent field id.</param>
/// <param name="id">The id of the field to disable.</param>
/// <param name="id">The id of the field to disable.</param>
/// <returns>
/// <returns>
@ -533,11 +533,11 @@ namespace Squidex.Areas.Api.Controllers.Schemas
/// 404 => Schema, field or app not found.
/// 404 => Schema, field or app not found.
/// </returns>
/// </returns>
[HttpDelete]
[HttpDelete]
[Route("apps/{app}/schemas/{name }/fields/{parentId:long}/nested/{id:long}/")]
[Route("apps/{app}/schemas/{schema }/fields/{parentId:long}/nested/{id:long}/")]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(SchemaDto), StatusCodes.Status200OK)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiPermissionOrAnonymous(Permissions.AppSchemasUpdate)]
[ApiCosts(1)]
[ApiCosts(1)]
public async Task < IActionResult > DeleteNestedField ( string app , string name , long parentId , long id )
public async Task < IActionResult > DeleteNestedField ( string app , string schema , long parentId , long id )
{
{
var command = new DeleteField { ParentFieldId = parentId , FieldId = id } ;
var command = new DeleteField { ParentFieldId = parentId , FieldId = id } ;