Skip to content

Commit

Permalink
Merge pull request #215 from neynarxyz/val/neyn-3531-update-inputs-fo…
Browse files Browse the repository at this point in the history
…r-patch-user-in-sdk

feat: PATCH user location
  • Loading branch information
tybook authored Oct 29, 2024
2 parents 20e1793 + 379e9a0 commit 5fe5fbe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/neynar-api/neynar-api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ import {
ChannelMemberListResponse,
FollowersResponse,
FarcasterActionReqBodyAction,
UpdateUserReqBodyLocation,
} from "./v2/openapi-farcaster";

import {
Expand Down Expand Up @@ -1215,6 +1216,7 @@ export class NeynarAPIClient {
* @param {string} [options.url] - Personal URL of the user.
* @param {string} [options.username] - The user's chosen username.
* @param {string} [options.displayName] - The user's display name.
* @param {UpdateUserReqBodyLocation} [options.location] - The user's location.
*
* @returns {Promise<OperationResponse>} A promise that resolves to an `OperationResponse` object,
* indicating the success or failure of the update operation.
Expand All @@ -1240,6 +1242,7 @@ export class NeynarAPIClient {
url?: string;
username?: string;
displayName?: string;
location?: UpdateUserReqBodyLocation;
}
): Promise<OperationResponse> {
return await this.clients.v2.updateUser(signerUuid, options);
Expand Down
4 changes: 4 additions & 0 deletions src/neynar-api/v2/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ import {
FarcasterActionReqBody,
FarcasterActionReqBodyAction,
ActionApi,
UpdateUserReqBodyLocation,
} from "./openapi-farcaster";
import axios, { AxiosError, AxiosInstance } from "axios";
import { silentLogger, Logger } from "../common/logger";
Expand Down Expand Up @@ -872,6 +873,7 @@ export class NeynarV2APIClient {
* @param {string} [options.url] - Personal URL of the user.
* @param {string} [options.username] - The user's chosen username.
* @param {string} [options.displayName] - The user's display name.
* @param {UpdateUserReqBodyLocation} [options.location] - The user's location.
*
* @returns {Promise<OperationResponse>} A promise that resolves to an `OperationResponse` object,
* indicating the success or failure of the update operation.
Expand All @@ -897,6 +899,7 @@ export class NeynarV2APIClient {
url?: string;
username?: string;
displayName?: string;
location?: UpdateUserReqBodyLocation;
}
): Promise<OperationResponse> {
const updateUserReqBody = {
Expand All @@ -906,6 +909,7 @@ export class NeynarV2APIClient {
url: options?.url,
username: options?.username,
display_name: options?.displayName,
location: options?.location,
};
const response = await this.apis.user.updateUser(
this.apiKey,
Expand Down

0 comments on commit 5fe5fbe

Please sign in to comment.