Skip to content

Commit

Permalink
Working ceramic+cache from frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
lucianHymer authored and tim-schultz committed Feb 3, 2023
1 parent 0342fbc commit cf9e24e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 3 additions & 2 deletions database-client/src/ceramicCacheClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class CeramicCacheDatabase implements DataStorageBase {

async createPassport(initialStamps?: Stamp[]): Promise<string> {
if (initialStamps?.length) {
this.addStamps(initialStamps);
await this.addStamps(initialStamps);
} else {
this.allowEmpty = true;
}
Expand All @@ -50,7 +50,7 @@ export class CeramicCacheDatabase implements DataStorageBase {
passport = {
issuanceDate: null,
expiryDate: null,
stamps: data.stamps,
stamps: data.stamps.map((stamp: any) => ({ ...stamp, credential: stamp.stamp })),
};
} else {
status = "DoesNotExist";
Expand Down Expand Up @@ -84,6 +84,7 @@ export class CeramicCacheDatabase implements DataStorageBase {
this.logger.error(`Error saving stamp to ceramicCache address: ${this.address}:` + e.toString());
}
}

async deleteStamp(provider: PROVIDER_ID): Promise<void> {
this.logger.info(`deleting stamp from ceramicCache for ${provider} on ${this.address}`);
try {
Expand Down
3 changes: 1 addition & 2 deletions types/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ export type PassportLoadStatus =
| "DoesNotExist"
| "ExceptionRaised"
| "StampCacaoError"
| "PassportCacaoError"
| "NoStampsInCache";
| "PassportCacaoError";

export type PassportLoadErrorDetails = {
stampStreamIds: string[];
Expand Down

0 comments on commit cf9e24e

Please sign in to comment.