Skip to content

Commit

Permalink
fix: get agent by user id method
Browse files Browse the repository at this point in the history
  • Loading branch information
lizandro-mc committed Nov 14, 2023
1 parent b2b58ee commit 75627a1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/modules/agents/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ export class Agents {
return response.data;
}

public async getAgentsByUserID(id: string): Promise<AgentsData> {
public async getAgentsByUserID(id: number): Promise<AgentsData> {
const where: WhereCondition = {
column: 'USERS_ID',
operator: 'EQ',
value: id,
};

const response = await this.client.query({
query: GET_AGENTS_BY_USER_ID_QUERY,
variables: { where },
Expand Down
2 changes: 1 addition & 1 deletion src/queries/agents.query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const GET_ALL_AGENTS_QUERY = gql`
`;

export const GET_AGENTS_BY_USER_ID_QUERY = gql`
query GetAgentsByUserID($where: QueryAgentsWhereWhereConditions!) {
query GetAgentsByUserID($where: QueryAgentsWhereWhereConditions) {
agents(where: $where) {
data {
member_id
Expand Down
1 change: 1 addition & 0 deletions src/types/agents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface Agent {
name: string;
status?: { name: string };
total_leads?: number;
created_at?: string;
user?: User;
owner?: Owner;
}
Expand Down

0 comments on commit 75627a1

Please sign in to comment.