Skip to content

Commit

Permalink
Update endpoint fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianStehle committed Nov 15, 2020
1 parent b86afd5 commit a31ff6f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,19 @@ public async Task<TEntity> UpsertAsync(string id, TData data, bool publish = fal
return await RequestJsonAsync<TEntity>(HttpMethod.Post, BuildSchemaUrl($"{id}?publish={publish}", false), data.ToContent(), ct: ct);
}

public Task<TEntity> UpsertAsync(TEntity entity, bool publish = false, CancellationToken ct = default)
{
Guard.NotNull(entity, nameof(entity));

return UpsertAsync(entity.Id, entity.Data, publish, ct);
}

public async Task<TEntity> UpdateAsync(string id, TData data, CancellationToken ct = default)
{
Guard.NotNullOrEmpty(id, nameof(id));
Guard.NotNull(data, nameof(data));

return await RequestJsonAsync<TEntity>(HttpMethod.Post, BuildSchemaUrl($"{id}", false), data.ToContent(), ct: ct);
return await RequestJsonAsync<TEntity>(HttpMethod.Put, BuildSchemaUrl($"{id}", false), data.ToContent(), ct: ct);
}

public Task<TEntity> UpdateAsync(TEntity entity, CancellationToken ct = default)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ namespace Squidex.ClientLibrary

Task<TEntity> UpsertAsync(string id, TData data, bool publish = false, CancellationToken ct = default);

Task<TEntity> UpsertAsync(TEntity entity, bool publish = false, CancellationToken ct = default);

Task<TEntity> UpdateAsync(string id, TData data, CancellationToken ct = default);

Task<TEntity> UpdateAsync(TEntity entity, CancellationToken ct = default);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageIcon>logo-squared.png</PackageIcon>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/Squidex/squidex/</PackageProjectUrl>
<Version>6.4.0</Version>
<Version>6.5.0</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="3.1.9" />
Expand Down

0 comments on commit a31ff6f

Please sign in to comment.