Skip to content

Commit

Permalink
check endpoint functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
SalmanAsh committed Aug 28, 2024
1 parent 1516850 commit 29c86a8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
19 changes: 11 additions & 8 deletions src/api/agreementSignature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export type AgreementSignature = Model<
{
contributor: number
agreement_id: string
signed_at: string
signed_at: Date
}
>

Expand Down Expand Up @@ -51,7 +51,7 @@ export type CreateAgreementSignatureArg = CreateArg<
export type CheckSignedAgreementSignatureResult =
| { latest_commit_id: string; status: 404 | 451 }
| { status: 200 }
export type CheckSignedAgreementSignatureArg = { contributor_id: number }
export type CheckSignedAgreementSignatureArg = { contributor_pk: number }

const agreementSignatureApi = api.injectEndpoints({
endpoints: build => ({
Expand Down Expand Up @@ -86,14 +86,17 @@ const agreementSignatureApi = api.injectEndpoints({
}),
invalidatesTags: tagData("AgreementSignature", { includeListTag: true }),
}),
checkSignedAgreementSignature: build.mutation<
checkSignedAgreementSignature: build.query<
CheckSignedAgreementSignatureResult,
CheckSignedAgreementSignatureArg
>({
query: ({ contributor_id }) => ({
url: buildUrl(agreementSignatureUrls.detail + "check-signed/", {
url: { contributor_id },
}),
query: ({ contributor_pk }) => ({
url: buildUrl(
agreementSignatureUrls.list + `check-signed/${contributor_pk}`,
{
url: { contributor_pk },
},
),
method: "GET",
}),
}),
Expand All @@ -107,5 +110,5 @@ export const {
useListAgreementSignaturesQuery,
useLazyListAgreementSignaturesQuery,
useCreateAgreementSignatureMutation,
useCheckSignedAgreementSignatureMutation,
useCheckSignedAgreementSignatureQuery,
} = agreementSignatureApi
2 changes: 1 addition & 1 deletion src/api/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const sessionApi = api.injectEndpoints({
endpoints: build => ({
loginWithGithub: build.mutation<LoginWithGithubResult, LoginWithGithubArg>({
query: body => ({
url: baseUrl + "login-with-github/",
url: baseUrl + "login-into-github/",
method: "POST",
body,
}),
Expand Down

0 comments on commit 29c86a8

Please sign in to comment.