Skip to content

Commit

Permalink
Merge pull request #337 from credebl/refactor-ecosystem-role-apis
Browse files Browse the repository at this point in the history
Refactor: accept and create ecosystem api and stored ecosystem role in config
  • Loading branch information
nishad-ayanworks authored Oct 12, 2023
2 parents c148a79 + 037c388 commit 469c4e5
Show file tree
Hide file tree
Showing 13 changed files with 617 additions and 511 deletions.
373 changes: 187 additions & 186 deletions src/api/invitations.ts

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/common/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ export enum IssueCredentialUserText {

export enum EndorsementType {
schema = 'schema',
credDef = 'credDef'
credDef = 'credential-definition'
}

export enum EndorsementStatus {
all = "all",
approved = "approved",
rejected = "rejected",
requested = "requested"
requested = "requested",
submitted = "submitted"
}

export enum EcosystemRoles {
Expand Down
1 change: 1 addition & 0 deletions src/components/Authentication/SignInUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const SignInUser = () => {

const saveEmail = async (values: emailValue) => {
setEmail(values)
await localStorage.clear();
setCurrentComponent('password');
await setToLocalStorage(storageKeys.LOGIN_USER_EMAIL, values.email);
setIsPasskeySuccess(true);
Expand Down
7 changes: 5 additions & 2 deletions src/components/CreateEcosystemOrgModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { asset } from '../../lib/data.js';
import { createOrganization } from "../../api/organization";
import { getFromLocalStorage } from "../../api/Auth";
import { createEcosystems } from "../../api/ecosystem";

import { getOrgDetails } from "../../config/ecosystem";

interface Values {
name: string;
Expand Down Expand Up @@ -162,13 +162,16 @@ const CreateEcosystemOrgModal = (props: IProps) => {
const submitCreateEcosystem = async (values: EcoValues) => {
try {
setLoading(true)
const orgDetails = await getOrgDetails()
const user_data = JSON.parse(await getFromLocalStorage(storageKeys.USER_PROFILE))
const ecoData = {
name: values.name,
description: values.description,
logo: logoImage?.imagePreviewUrl as string || "",
tags: "",
userId: Number(user_data?.id)
userId: Number(user_data?.id),
orgName: orgDetails?.orgName,
orgDid: orgDetails?.orgDid
}
const resCreateEco = await createEcosystems(ecoData)

Expand Down
Loading

0 comments on commit 469c4e5

Please sign in to comment.