Skip to content

Commit e9bf012

Browse files
committed
fix(issue-60): successfully upload content now
1 parent 4063bd4 commit e9bf012

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

services/poc/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ services:
2727
image: docker.io/dgraph/standalone:latest
2828
container_name: dgraph
2929
ports:
30-
- "8008:8080" # Dgraph Ratel UI
30+
- "8000:8000" # Dgraph Ratel UI
3131
- "9080:9080" # Dgraph gRPC
3232
volumes:
3333
- dgraph-data:/dgraph

services/poc/ui/upload_content.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ func (r *UploadContentRequest) Spec() (openapi3.RequestBodyOrRef, error) {
105105
}
106106

107107
type uploadContentHandler struct {
108-
dgraph *dgo.Dgraph
109-
minio *storage.MinioClient
110-
template *template.Template
108+
dgraph *dgo.Dgraph
109+
minio *storage.MinioClient
110+
template *template.Template
111111
}
112112

113113
func UploadContent(dgraph *dgo.Dgraph, minio *storage.MinioClient) rest.ApiOption {
@@ -136,7 +136,7 @@ func (h *uploadContentHandler) Handle(ctx context.Context, req *UploadContentReq
136136
}
137137
}`
138138

139-
vars := map[string]string{"journeyID": req.JourneyID}
139+
vars := map[string]string{"$journeyID": req.JourneyID}
140140
resp, err := h.dgraph.NewReadOnlyTxn().QueryWithVars(ctx, query, vars)
141141
if err != nil {
142142
return nil, fmt.Errorf("failed to query journey: %w", err)
@@ -165,6 +165,8 @@ func (h *uploadContentHandler) Handle(ctx context.Context, req *UploadContentReq
165165
}
166166
}
167167

168+
htmlFragments.WriteString(`<div id="content-form-modal" hx-swap-oob="innerHTML"></div>`)
169+
168170
return &HtmlResponse{
169171
ContentType: "text/html; charset=utf-8",
170172
Body: htmlFragments.Bytes(),

0 commit comments

Comments
 (0)