+
Skip to content

fix additional column options #497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions src/Mix.Cms.Lib/Controllers/BaseAuthorizedRestApiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,21 @@ public virtual async Task<ActionResult<TModel>> Delete(string id)
return GetResponse(result);
}

// POST api/update-infos
[HttpPost]
[Route("save-many")]
public async Task<RepositoryResponse<List<TUpdate>>> UpdateInfos([FromBody] List<TUpdate> models)
{
if (models != null)
{
return await SaveManyAsync(models, false);
}
else
{
return new RepositoryResponse<List<TUpdate>>();
}
}

[HttpPost]
[Route("list-action")]
public async Task<ActionResult<JObject>> ListActionAsync([FromBody] ListAction<string> data)
Expand Down Expand Up @@ -355,7 +370,7 @@ private async Task<RepositoryResponse<List<TUpdate>>> PublishListAsync(Expressio
{
ReflectionHelper.SetPropertyValue(item, new JProperty("Status", MixContentStatus.Published));
}
return await SaveListAsync(data.Data.Items, false);
return await SaveManyAsync(data.Data.Items, false);
}

protected virtual async Task<RepositoryResponse<T>> GetSingleAsync<T>(string id)
Expand Down Expand Up @@ -562,7 +577,7 @@ protected async Task<RepositoryResponse<TModel>> SavePropertiesAsync(JObject obj
return new RepositoryResponse<TModel>();
}

protected async Task<RepositoryResponse<List<TUpdate>>> SaveListAsync(List<TUpdate> lstVm, bool isSaveSubModel)
protected async Task<RepositoryResponse<List<TUpdate>>> SaveManyAsync(List<TUpdate> lstVm, bool isSaveSubModel)
{
var result = await DefaultRepository<TDbContext, TModel, TUpdate>.Instance.SaveListModelAsync(lstVm, isSaveSubModel);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public override void ExpandView(MixCmsContext _context = null, IDbContextTransac

if (MixDatabaseColumnId > 0)
{
Column ??= MixDatabaseColumns.UpdateViewModel.Repository.GetSingleModel(
Column = MixDatabaseColumns.UpdateViewModel.Repository.GetSingleModel(
f => f.Id == MixDatabaseColumnId
, _context, _transaction).Data;
if (Column != null && DataType == MixDataType.Reference)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public override async Task<RepositoryResponse<bool>> SaveSubModelsAsync(MixPorta

public override async Task<RepositoryResponse<bool>> RemoveRelatedModelsAsync(UpdateViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null)
{
var removeNavs = await MixPortalPagePortalPages.UpdateViewModel.Repository.RemoveListModelAsync(false, p => p.PageId == Id || p.ParentId == Id);
var removeNavs = await MixPortalPagePortalPages.UpdateViewModel.Repository.RemoveListModelAsync(false, p => p.PageId == Id || p.ParentId == Id, _context, _transaction);
var result = new RepositoryResponse<bool>()
{
IsSucceed = true,
Expand Down
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载