Skip to content

Commit 51d894f

Browse files
committed
Fixed 201 Created handling after form submission
1 parent afd8f0f commit 51d894f

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

  • src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client

src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/form.xsl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,9 @@ WHERE
891891
<xsl:when test="$status = (200, 204)">
892892
<xsl:sequence select="ldh:form-horizontal-submit-success($context)"/>
893893
</xsl:when>
894+
<xsl:when test="$status = 201 and map:contains($response?headers, 'location')">
895+
<xsl:sequence select="ldh:form-submit-created($context)"/>
896+
</xsl:when>
894897
<xsl:when test="$status = (400, 422) and starts-with($media-type, 'application/rdf+xml')">
895898
<xsl:sequence select="ldh:row-form-submit-violation($context)"/>
896899
</xsl:when>
@@ -913,7 +916,7 @@ WHERE
913916
<xsl:sequence select="ldh:form-horizontal-submit-success($context)"/>
914917
</xsl:when>
915918
<xsl:when test="$status = 201 and map:contains($response?headers, 'location')">
916-
<xsl:sequence select="ldh:modal-form-submit-created($context)"/> <!-- 201 Created an only happen via PUT from modal form -->
919+
<xsl:sequence select="ldh:form-submit-created($context)"/>
917920
</xsl:when>
918921
<xsl:when test="$status = (400, 422) and starts-with($media-type, 'application/rdf+xml')">
919922
<xsl:sequence select="ldh:modal-form-submit-violation($context)"/>
@@ -1004,11 +1007,11 @@ WHERE
10041007
</xsl:for-each>
10051008
</xsl:function>
10061009

1007-
<xsl:function name="ldh:modal-form-submit-created" ixsl:updating="yes">
1010+
<xsl:function name="ldh:form-submit-created" ixsl:updating="yes">
10081011
<xsl:param name="context" as="map(*)"/>
10091012
<xsl:variable name="response" select="$context('response')" as="map(*)"/>
10101013

1011-
<xsl:message>ldh:modal-form-submit-created</xsl:message>
1014+
<xsl:message>ldh:form-submit-created</xsl:message>
10121015

10131016
<xsl:for-each select="$response">
10141017
<xsl:variable name="href" select="?headers?location" as="xs:anyURI"/>

0 commit comments

Comments
 (0)