CmsKit - Remove SetContentByEntity

pull/7404/head
enisn 5 years ago
parent c96d364c39
commit 15ba1bdfb5

@ -15,7 +15,5 @@ namespace Volo.CmsKit.Admin.Contents
ContentUpdateDto>
{
Task<ContentDto> GetByEntityAsync(string entityType, string entityId);
Task SetByEntityAsync(string entityType, string entityId, ContentSetByEntityInput input);
}
}

@ -68,32 +68,5 @@ namespace Volo.CmsKit.Admin.Contents
return ObjectMapper.Map<Content, ContentDto>(content);
}
public async Task SetByEntityAsync(
[NotNull] string entityType,
[NotNull] string entityId,
ContentSetByEntityInput input)
{
Check.NotNullOrWhiteSpace(entityType, nameof(entityType));
Check.NotNullOrWhiteSpace(entityId, nameof(entityId));
var updated = await ContentRepository.FindAsync(entityType, entityId);
if (updated == null)
{
await ContentRepository.InsertAsync(
new Content(
GuidGenerator.Create(),
entityType,
entityId,
input.Value,
CurrentTenant?.Id));
}
else
{
updated.SetValue(input.Value);
await ContentRepository.UpdateAsync(updated);
}
}
}
}

@ -67,13 +67,5 @@ namespace Volo.CmsKit.Admin.Contents
{
return ContentAdminAppService.GetByEntityAsync(entityType, entityId);
}
[HttpPost]
[Route("{entityType}/{entityId}")]
[Authorize(CmsKitAdminPermissions.Contents.Update)]
public Task SetByEntityAsync(string entityType, string entityId, ContentSetByEntityInput input)
{
return ContentAdminAppService.SetByEntityAsync(entityType, entityId, input);
}
}
}

Loading…
Cancel
Save