Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getListLocations -> getLocations #162

Merged
merged 2 commits into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ class StripeTerminalReactNativeModule(reactContext: ReactApplicationContext) :

@ReactMethod
@Suppress("unused")
fun getListLocations(params: ReadableMap, promise: Promise) {
fun getLocations(params: ReadableMap, promise: Promise) {
val listParameters = ListLocationsParameters.Builder()
listParameters.endingBefore = getStringOr(params, "endingBefore")
listParameters.startingAfter = getStringOr(params, "startingAfter")
Expand All @@ -565,7 +565,7 @@ class StripeTerminalReactNativeModule(reactContext: ReactApplicationContext) :
override fun onSuccess(locations: List<Location>, hasMore: Boolean) {
val list = mapFromListLocations(locations)
val result = WritableNativeMap()
result.putArray("locationsList", list)
result.putArray("locations", list)
result.putBoolean("hasMore", hasMore)
promise.resolve(result)
}
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,6 @@ SPEC CHECKSUMS:
StripeTerminal: 2c7d261881b0039693a6ba30c00e1e6133e6d393
Yoga: 32a18c0e845e185f4a2a66ec76e1fd1f958f22fa

PODFILE CHECKSUM: 617d5d5a75b2b359fc53061af7f2624d7349ec04
PODFILE CHECKSUM: 7dc744410dfefabb790965a6dbea3cfd4138e31c

COCOAPODS: 1.11.2
8 changes: 4 additions & 4 deletions example/src/screens/LocationListScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ export default function LocationListScreen() {
const navigation = useNavigation();
const { params } = useRoute<RouteProp<any, any>>();

const { getListLocations, loading } = useStripeTerminal();
const { getLocations, loading } = useStripeTerminal();
const [list, setList] = useState<Location[]>([]);

useEffect(() => {
async function init() {
const { locationsList } = await getListLocations({ limit: 20 });
if (locationsList) {
setList(locationsList);
const { locations } = await getLocations({ limit: 20 });
if (locations) {
setList(locations);
}
}
init();
Expand Down
Loading