[Webapi]歷史資料常用組合檔重複名稱
This commit is contained in:
parent
f49d2a749f
commit
5c2ccb1304
@ -19,6 +19,7 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using Microsoft.CodeAnalysis;
|
||||||
|
|
||||||
|
|
||||||
namespace FrontendWebApi.ApiControllers
|
namespace FrontendWebApi.ApiControllers
|
||||||
@ -1610,6 +1611,14 @@ namespace FrontendWebApi.ApiControllers
|
|||||||
public async Task<ActionResult<ApiResult<List<HistoryFavorite>>>> SaveHistoryFavorite([FromBody] HistoryFavorite post)
|
public async Task<ActionResult<ApiResult<List<HistoryFavorite>>>> SaveHistoryFavorite([FromBody] HistoryFavorite post)
|
||||||
{
|
{
|
||||||
ApiResult<List<HistoryFavorite>> apiResult = new ApiResult<List<HistoryFavorite>>(jwt_str);
|
ApiResult<List<HistoryFavorite>> apiResult = new ApiResult<List<HistoryFavorite>>(jwt_str);
|
||||||
|
var favorite = await frontendRepository.GetOneAsync<HistoryFavorite>("history_favorite", "favorite_name = @favorite_name and deleted = 0", new { favorite_name = post.favorite_name });
|
||||||
|
if (favorite != null)
|
||||||
|
{
|
||||||
|
apiResult.Code = "5000";
|
||||||
|
apiResult.Msg = "已有該組合名稱";
|
||||||
|
|
||||||
|
return Ok(apiResult);
|
||||||
|
}
|
||||||
if (!jwtlife)
|
if (!jwtlife)
|
||||||
{
|
{
|
||||||
apiResult.Code = "5000";
|
apiResult.Code = "5000";
|
||||||
|
Loading…
Reference in New Issue
Block a user