Skip to content
This repository was archived by the owner on Oct 29, 2020. It is now read-only.

Adds competition param to signup index#6322

Merged
itsjoekent merged 3 commits intoDoSomethingArchive:devfrom
itsjoekent-archive:6316
Mar 25, 2016
Merged

Adds competition param to signup index#6322
itsjoekent merged 3 commits intoDoSomethingArchive:devfrom
itsjoekent-archive:6316

Conversation

@itsjoekent
Copy link
Contributor

What's this PR do?

Adds competition parameter to the signup index endpoint, this does two things.
1- Only include signups that are marked as competition signups.
2- Order the signups by quantity.

How should this be manually tested?

Checkout http://dev.dosomething.org:8888/api/v1/signups?competition=1

Any background context you want to provide?

nope

What are the relevant tickets?

Fixes #6316

@weerd
Copy link
Contributor

weerd commented Mar 25, 2016

Just fyi, don't use integers in the examples or what gets passed as params. More obvious to use true/false booleans.

@itsjoekent
Copy link
Contributor Author

gotcha!

],
[
'name' => 'competition',
'description' => 'Only competition signups, defaults to 0.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defaults to false.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true false true false

@angaither
Copy link
Contributor

@deadlybutter does this play nice with other params? can we request competition signups for just one campaign?

@angaither angaither closed this Mar 25, 2016
@angaither angaither reopened this Mar 25, 2016
@angaither
Copy link
Contributor

ahh, sorry hit close instead of comment!

@itsjoekent
Copy link
Contributor Author

SHAME.

@itsjoekent
Copy link
Contributor Author

@angaither let me give that a try actually, but i think it should

@chloealee
Copy link
Contributor

👍 from me!

@itsjoekent
Copy link
Contributor Author

can confirm it works with the other params @angaither also @weerd updated your stuffs

@weerd
Copy link
Contributor

weerd commented Mar 25, 2016

K. Rechecking 💃

'campaigns' => dosomething_helpers_format_data($parameters['campaigns']),
'count' => (int) $parameters['count'] ?: 25,
'page' => (int) $parameters['page'],
'competition' => (int) $parameters['competition'] ?: NULL,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to cast to (int) here.

@itsjoekent
Copy link
Contributor Author

already fixed @weerd haha

@weerd
Copy link
Contributor

weerd commented Mar 25, 2016

Cool! 👍

@itsjoekent itsjoekent merged commit bce57ab into DoSomethingArchive:dev Mar 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants