mirror of
https://gitlab.com/buildfeed/BuildFeed.git
synced 2024-03-22 21:10:34 +08:00
Bugfix for the API update
This commit is contained in:
parent
676eb3d7f9
commit
68c7b3c659
@ -170,14 +170,17 @@ namespace BuildFeed.Models
|
|||||||
[DataObjectMethod(DataObjectMethodType.Insert, false)]
|
[DataObjectMethod(DataObjectMethodType.Insert, false)]
|
||||||
public async Task InsertAll(IEnumerable<BuildModel> items)
|
public async Task InsertAll(IEnumerable<BuildModel> items)
|
||||||
{
|
{
|
||||||
|
List<BuildModel> generatedItems = new List<BuildModel>();
|
||||||
foreach (BuildModel item in items)
|
foreach (BuildModel item in items)
|
||||||
{
|
{
|
||||||
item.Id = Guid.NewGuid();
|
item.Id = Guid.NewGuid();
|
||||||
item.LabUrl = item.GenerateLabUrl();
|
item.LabUrl = item.GenerateLabUrl();
|
||||||
|
|
||||||
|
generatedItems.Add(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
await _buildCollection
|
await _buildCollection
|
||||||
.InsertManyAsync(items);
|
.InsertManyAsync(generatedItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
[DataObjectMethod(DataObjectMethodType.Update, true)]
|
[DataObjectMethod(DataObjectMethodType.Update, true)]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user