Skip to content

Commit

Permalink
Update create JSON schema implementation for create manifest (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
kirahsapong authored Jun 1, 2023
1 parent b6f542e commit c151236
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ const IssueModal: Component<{ content }> = (props) => {
export default IssueModal;

const getSchemaForSubject = (schemaId) => {
const { schema } = store.schemas.find(({schema}) => schema.id === schemaId);
const { $id, $schema, description, ...properties } = schema.schema;
const schema = store.schemas.find(({schema}) => schema["$id"].endsWith(`/v1/schemas/${schemaId}`));
const { $id, $schema, description, name, ...properties } = schema.schema;
return properties;
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ const Modal: Component<{ content }> = (props) => {
let schemaId = formValues().schemaId;
if (schemaId === '') {
const schemaPayload = {
"author": store.user[formValues().issuer]["did"],
"authorKid": store.user[formValues().issuer]["kid"],
"name": formValues().name,
"schema": JSON.parse(formValues().schema),
"sign": true
"schema": {
...JSON.parse(formValues().schema),
"$schema": "https://json-schema.org/draft/2020-12/schema"
}
}
const schemaResponse = await SSI.putSchema(schemaPayload);
const { id } = await schemaResponse.json();
Expand Down

0 comments on commit c151236

Please sign in to comment.