feat(client): ts-migration for Introduction templates (#43752)

* chore: rename the file CertificationCard.js to tsx

* refactor: refactor the file CertificationCard to tsx

refactor: refactor the file CertificationCard to tsx

refactor: refactor the file CertificationCard to tsx

* chore: rename the file ClaimCertSteps.js to tsx

* refactor: refactor the file ClaimCertSteps to TS

* chore: rename the file SuperBlockIntro.js to tsx

* refactor: refactor the file SuperBlockIntro to TS

* chore: rename the file Block.js to tsx

* refactor: refactor the file Block to TS

refactor: refactor the file Block to TS

refactor: refactor the file Block to TS

* chore: rename the file CertChallenge.js to tsx

* refactor: refactor the file CertChallenge to TS

* fix typing

* ignore missing redux store connection

Co-authored-by: ismail <i.tlemcani@quinten-maroc.com>
Co-authored-by: Ismail Tlemcani <ismail.tlemcani@gmail.com>
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
This commit is contained in:
Ismail Tlemcani
2021-11-30 19:36:33 +01:00
committed by GitHub
parent 513f27e408
commit 845659105f
8 changed files with 164 additions and 124 deletions

View File

@@ -3,6 +3,7 @@ import envData from '../../../config/env.json';
import type {
ChallengeFile,
ClaimedCertifications,
CompletedChallenge,
User
} from '../redux/prop-types';
@@ -158,11 +159,25 @@ export function getUsernameExists(username: string): Promise<boolean> {
return get(`/api/users/exists?username=${username}`);
}
// TODO: Does a GET return a bolean?
export interface GetVerifyCanClaimCert {
response: {
type: string;
message: {
status: boolean;
result: string;
};
variables: {
name: string;
};
};
isCertMap: ClaimedCertifications;
completedChallenges: CompletedChallenge[];
}
export function getVerifyCanClaimCert(
username: string,
superBlock: string
): Promise<boolean> {
): Promise<GetVerifyCanClaimCert> {
return get(
`/certificate/verify-can-claim-cert?username=${username}&superBlock=${superBlock}`
);