V15: Add authorization to create (#18169)
* Add failing tests * Re-add auth
This commit is contained in:
@@ -28,4 +28,32 @@ public static class DocumentUpdateHelper
|
||||
|
||||
return updateRequestModel;
|
||||
}
|
||||
|
||||
public static CreateDocumentRequestModel CreateDocumentRequestModel(ContentCreateModel createModel)
|
||||
{
|
||||
var createDocumentRequestModel = new CreateDocumentRequestModel
|
||||
{
|
||||
Template = ReferenceByIdModel.ReferenceOrNull(createModel.TemplateKey),
|
||||
DocumentType = new ReferenceByIdModel(createModel.ContentTypeKey),
|
||||
Parent = ReferenceByIdModel.ReferenceOrNull(createModel.ParentKey),
|
||||
};
|
||||
|
||||
createDocumentRequestModel.Variants =
|
||||
[
|
||||
new DocumentVariantRequestModel
|
||||
{
|
||||
Segment = null,
|
||||
Culture = null,
|
||||
Name = createModel.InvariantName!,
|
||||
}
|
||||
];
|
||||
createDocumentRequestModel.Values = createModel.InvariantProperties.Select(x => new DocumentValueModel
|
||||
{
|
||||
Alias = x.Alias,
|
||||
Value = x.Value,
|
||||
});
|
||||
|
||||
|
||||
return createDocumentRequestModel;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user