Skip to content

Commit 7c8ba58

Browse files
committed
chore: fix evaul-core
1 parent 2ec721d commit 7c8ba58

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

infrastructure/evault-core/src/db/db.service.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,10 +381,20 @@ export class DbService {
381381
acl: string[],
382382
): Promise<StoreMetaEnvelopeResult<T>> {
383383
try {
384-
// First, get the existing meta-envelope to find existing envelopes
385-
const existing = await this.findMetaEnvelopeById<T>(id);
384+
let existing = await this.findMetaEnvelopeById<T>(id);
386385
if (!existing) {
387-
throw new Error(`Meta-envelope with id ${id} not found`);
386+
const metaW3id = await new W3IDBuilder().build();
387+
await this.runQuery(
388+
`
389+
CREATE (m:MetaEnvelope {
390+
id: $id,
391+
ontology: $ontology,
392+
acl: $acl
393+
})
394+
`,
395+
{ id, ontology: meta.ontology, acl }
396+
);
397+
existing = { id, ontology: meta.ontology, acl, parsed: meta.payload, envelopes: [] };
388398
}
389399

390400
// Update the meta-envelope properties

0 commit comments

Comments
 (0)