Skip to content

Commit 91b22d7

Browse files
author
Doris Lam
committed
auto add org
1 parent 93891fe commit 91b22d7

2 files changed

Lines changed: 25 additions & 3 deletions

File tree

src/main/kotlin/org/openmbee/flexo/sysmlv2/apis/CommitApi.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,12 @@ fun Route.CommitApi() {
425425
delete {
426426
?element_n ?element_p ?element_o .
427427
428-
?incoming ?incoming_p ?element_del ;
429-
?incoming_order_p ?incoming_order_o .
428+
${if(deleteIncoming.isNotEmpty()) {
429+
"""
430+
?incoming ?incoming_relation_p ?element_del ;
431+
?incoming_order_p ?incoming_order_o .
432+
""".reindent(4)
433+
} else ""}
430434
}
431435
insert {
432436
${inserts.joinToString("\n\n").reindent(4)}

src/main/kotlin/org/openmbee/flexo/sysmlv2/apis/ProjectApi.kt

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
*/
1212
package org.openmbee.flexo.sysmlv2.apis
1313

14+
import io.ktor.client.request.*
15+
import io.ktor.http.*
1416
import io.ktor.server.application.*
1517
import io.ktor.server.resources.*
1618
import io.ktor.server.response.*
@@ -94,9 +96,17 @@ fun Route.ProjectApi() {
9496

9597
// create new project via POST
9698
post<ProjectRequest>("/projects") { projectRequest ->
99+
//just always make sure org is there
100+
flexoRequestPut {
101+
orgPath("")
102+
turtle {"""
103+
<> dct:title "sysmlv2"@en .
104+
"""
105+
}
106+
}
97107
// generate a UUID for the repo
98108
val repoUuid = UUID.randomUUID()
99-
109+
100110
// generate a UUID for the default branch
101111
val branchUuid = UUID.randomUUID()
102112

@@ -136,6 +146,14 @@ fun Route.ProjectApi() {
136146

137147
// create new project via PUT
138148
put<ProjectRequest>("/projects/{projectId}") { projectRequest ->
149+
//just always make sure org is there
150+
flexoRequestPut {
151+
orgPath("")
152+
turtle {"""
153+
<> dct:title "sysmlv2"@en .
154+
"""
155+
}
156+
}
139157
val projectId = "${call.parameters["projectId"]}"
140158

141159
// generate a UUID for the default branch

0 commit comments

Comments
 (0)