Skip to content

Commit

Permalink
Merge pull request #79 from verida/feature/78-error-issuing-credential
Browse files Browse the repository at this point in the history
fix(credentials):  work on error displaying some schemas
  • Loading branch information
nick-verida authored Jun 2, 2022
2 parents 2499749 + d1d04df commit e7db6f3
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 50 deletions.
10 changes: 5 additions & 5 deletions backend/src/modules/schema/schema.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import { SchemaModel } from '../../models/Schemas';
import { UserService } from '../user/user.service';
import VeridaHelper from 'src/helpers/VeridaHelper';
import { UserIdentity } from 'src/models/User';
// import Verida from '@verida/datastore';
// import { SCHEMAS } from 'src/utils/schemas';

@UseGuards(AuthGuard('jwt'))
@Controller('schema')
Expand All @@ -25,17 +23,19 @@ export class SchemaController {
private authService: AuthService,
private schemaService: SchemaService,
private userService: UserService,
) {}
) { }

@UseGuards(AuthGuard('jwt'))
@Get()
async findAll(@Headers() headers): Promise<unknown> {
const user = (await this.authService.userByToken(headers)) as UserIdentity;
const response = await this.schemaService.getSchemas(user['issuerId']);

const schemaTitles = response.map(res => res.schemaUrl)

const schemas = await Promise.all(
response.map(schema =>
VeridaHelper.getSchemaJSon(user.issuer, schema.schemaUrl),
schemaTitles.map(schema =>
VeridaHelper.getSchemaJSon(user.issuer, schema),
),
);

Expand Down
90 changes: 45 additions & 45 deletions frontend/src/config/map.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
export const schemas = {
"https://common.schemas.verida.io/health/pathology/tests/cholesterol/total/v0.1.0/schema.json": {
view: ["testType", "testResult"],
create: [
"fullName",
"dateOfBirth",
"patientId",
"testTimestamp",
"result",
"acceptable",
],
},
"https://27tqk.csb.app/schemas/health-prescription.json": {
view: ["name", "medication", "issueDate"],
create: ["name", "notes", "medication", "dateOfBirth", "purpose"],
},
"https://common.schemas.verida.io/health/pathology/tests/covid19/pcr/v0.1.0/schema.json": {
view: ["testType", "testResult"],
create: ["fullName", "dateOfBirth", "patientId", "testTimestamp", "result"],
},
"https://common.schemas.verida.io/health/pathology/tests/glucose/fasting/v0.1.0/schema.json": {
view: ["testType", "testResult"],
create: [
"fullName",
"dateOfBirth",
"patientId",
"testTimestamp",
"result",
"acceptable",
],
},
"https://common.schemas.verida.io/health/pathology/tests/haemoglobin/v0.1.0/schema.json": {
view: ["testType", "testResult"],
create: [
"fullName",
"dateOfBirth",
"patientId",
"testTimestamp",
"result",
"acceptable",
],
},
"https://common.schemas.verida.io/health/pathology/tests/syphilis/ab/v0.1.0/schema.json": {
view: ["testType", "testResult"],
create: ["fullName", "dateOfBirth", "patientId", "testTimestamp", "result"],
},
"https://common.schemas.verida.io/health/pathology/tests/cholesterol/total/v0.1.0/schema.json": {
view: ["testType", "testResult"],
create: [
"fullName",
"dateOfBirth",
"patientId",
"testTimestamp",
"result",
"acceptable",
],
},
// "https://27tqk.csb.app/schemas/health-prescription.json": {
// view: ["name", "medication", "issueDate"],
// create: ["name", "notes", "medication", "dateOfBirth", "purpose"],
// },
"https://common.schemas.verida.io/health/pathology/tests/covid19/pcr/v0.1.0/schema.json": {
view: ["testType", "testResult"],
create: ["fullName", "dateOfBirth", "patientId", "testTimestamp", "result"],
},
"https://common.schemas.verida.io/health/pathology/tests/glucose/fasting/v0.1.0/schema.json": {
view: ["testType", "testResult"],
create: [
"fullName",
"dateOfBirth",
"patientId",
"testTimestamp",
"result",
"acceptable",
],
},
"https://common.schemas.verida.io/health/pathology/tests/haemoglobin/v0.1.0/schema.json": {
view: ["testType", "testResult"],
create: [
"fullName",
"dateOfBirth",
"patientId",
"testTimestamp",
"result",
"acceptable",
],
},
"https://common.schemas.verida.io/health/pathology/tests/syphilis/ab/v0.1.0/schema.json": {
view: ["testType", "testResult"],
create: ["fullName", "dateOfBirth", "patientId", "testTimestamp", "result"],
},
};

0 comments on commit e7db6f3

Please sign in to comment.