Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
shopify_iossdk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cemarose
shopify_iossdk
Commits
3b7520ca
Commit
3b7520ca
authored
May 12, 2016
by
Dima Bart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor get products page to assert instead of return error.
parent
678ed804
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
9 deletions
+3
-9
BUYClient.m
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient.m
+3
-9
No files found.
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient.m
View file @
3b7520ca
...
...
@@ -221,8 +221,8 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
-
(
NSURLSessionDataTask
*
)
getProductsPage
:
(
NSUInteger
)
page
inCollection
:
(
NSNumber
*
)
collectionId
sortOrder
:
(
BUYCollectionSort
)
sortOrder
completion
:
(
BUYDataProductListBlock
)
block
{
NS
URLSessionDataTask
*
task
=
nil
;
if
(
collectionId
)
{
NS
Assert
(
collectionId
,
@"Failed to get products page. Invalid collectionID."
)
;
NSURLComponents
*
components
=
[
self
URLComponentsForChannelsAppendingPath
:
kBUYClientPathProductPublications
queryItems
:@{
@"collection_id"
:
collectionId
.
stringValue
,
...
...
@@ -231,7 +231,7 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
@"sort_by"
:
[
BUYCollection
sortOrderParameterForCollectionSort
:
sortOrder
]
}];
task
=
[
self
getRequestForURL
:
components
.
URL
completionHandler
:
^
(
NSDictionary
*
json
,
NSURLResponse
*
response
,
NSError
*
error
)
{
return
[
self
getRequestForURL
:
components
.
URL
completionHandler
:
^
(
NSDictionary
*
json
,
NSURLResponse
*
response
,
NSError
*
error
)
{
NSArray
*
products
=
nil
;
if
(
json
&&
!
error
)
{
...
...
@@ -239,12 +239,6 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
}
block
(
products
,
page
,
[
self
hasReachedEndOfPage
:
products
]
||
error
,
error
);
}];
}
else
{
block
(
nil
,
0
,
NO
,
[
NSError
errorWithDomain
:
kShopifyError
code
:
BUYShopifyError_NoCollectionIdSpecified
userInfo
:
nil
]);
}
return
task
;
}
#pragma mark - Helpers
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment