Skip to content

Commit

Permalink
Merge pull request #346 from bakaphp/feat/CAD-147
Browse files Browse the repository at this point in the history
Feat/cad 147
  • Loading branch information
jaimetorresmctekk authored Nov 12, 2024
2 parents 4b227b1 + dee584f commit e043756
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.18.3",
"version": "0.18.4",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down
8 changes: 4 additions & 4 deletions src/modules/people/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class People {
): Promise<PeopleInterface> {
const response = await this.client.mutate({
mutation: CREATE_PEOPLE_MUTATION,
variables: { input: input },
variables: { input },
});
return response.data.createPeople as PeopleInterface;
}
Expand All @@ -39,23 +39,23 @@ export class People {
): Promise<PeopleInterface> {
const response = await this.client.mutate({
mutation: UPDATE_PEOPLE_MUTATION,
variables: { id: id, input: input },
variables: { id, input },
});
return response.data.updatePeople as PeopleInterface;
}

public async deletePeople(id: string): Promise<Boolean> {
const response = await this.client.mutate({
mutation: DELETE_PEOPLE_MUTATION,
variables: { id: id },
variables: { id },
});
return response.data.deletePeople as Boolean;
}

public async restorePeople(id: string): Promise<Boolean> {
const response = await this.client.mutate({
mutation: RESTORE_PEOPLE_MUTATION,
variables: { id: id },
variables: { id },
});
return response.data.restorePeople as Boolean;
}
Expand Down
6 changes: 6 additions & 0 deletions src/mutations/people.mutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ export const CREATE_PEOPLE_MUTATION = gql`
name
firstname
lastname
organizations {
name
}
company {
id
name
Expand Down Expand Up @@ -45,6 +48,9 @@ export const UPDATE_PEOPLE_MUTATION = gql`
name
firstname
lastname
organizations {
name
}
company {
id
name
Expand Down
3 changes: 3 additions & 0 deletions src/queries/people.query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export const PEOPLE_QUERY = gql`
name
firstname
lastname
organizations {
name
}
company {
id
name
Expand Down
2 changes: 2 additions & 0 deletions src/types/people.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface PeopleInputInterface {
firstname: string;
middlename?: string;
lastname: string;
organization: string;
facebook_contact_id?: string;
twitter_contact_id?: string;
linkedin_contact_id?: string;
Expand Down Expand Up @@ -49,6 +50,7 @@ export interface PeopleInterface {
name: string;
firstname: string;
lastname: string;
organizations: OrganizationInterface[];
company?: CompanyInterface;
contacts: ContactInterface[];
address?: AddressInterface[];
Expand Down

0 comments on commit e043756

Please sign in to comment.