Skip to content

Conversation

@anhanh11001
Copy link
Contributor

@anhanh11001 anhanh11001 commented May 24, 2019

Details:

Fixes: #1811

Screenshots for the change:

ezgif-4-94cf806dc384

ezgif-4-6315722607c0

Copy link
Member

@nikit19 nikit19 left a comment

Choose a reason for hiding this comment

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

Please complete one WIP PR before sending another.

@anhanh11001
Copy link
Contributor Author

@nikit19 Yes, I understand it, and both current WIP PR I'm sending take me more time then I expected, but I'll make sure I finish them as soon as possible, hopefully around today evening. I sent them to let the mentors and other contributors know that I'm still making some progress

@anhanh11001
Copy link
Contributor Author

anhanh11001 commented May 25, 2019

@nikit19 @iamareebjamal Do you know how to make a filter in making GET request. I'm trying to take a speaker under event and user by this:

@GET("users/{userId}/speakers?include=event,user&fields[event]=id&fields[user]=id")
    fun getSpeakerUnderUserAndEvent
        (@Path("userId") userId: Long, @Query("event", encoded = true) eventId: EventId): Single<Speaker>

or

@GET("users/{userId}/speakers?include=event,user&fields[event]=id&fields[user]=id")
    fun getSpeakerUnderUserAndEvent
        (@Path("userId") userId: Long, @Query("event", encoded = true) eventId: Long): Single<Speaker>

But both of this return a list of speakers under user without filtering the event ID given.

@iamareebjamal
Copy link
Member

There's no filter applied and the query itself is wrong. Why are you querying users/{user_id}?

@anhanh11001
Copy link
Contributor Author

In the frontend, the information about my speaker is stored in each event when I try to send a proposal. If not, then I would have to create a new speaker.

I'm trying to do the same thing but I don't know how to save the current speaker detail. So I was trying to create a speaker under a user and event, save that in the server and then query it to check whether I have an existing user or not.

I query users/{user_id} as I follow this from the documentation. This does return a list of speakers
Capture

@iamareebjamal
Copy link
Member

But you haven't applied any filter

@anhanh11001
Copy link
Contributor Author

So putting this @Query("event", encoded = true) eventId: EventId in the function is not correct way to filter.. . So I'll spend time on reading about the filter part and I will update if I still have problems

@iamareebjamal
Copy link
Member

users/{userId}/speakers?include=event,user&fields[event]=id&fields[user]=id

There is no filter in the query. Adding event in the query will just make it

users/33/speakers?include=event,user&fields[event]=id&fields[user]=id&event=234

Also you are using encoded EventId and not an int, which will result in God knows what

How filters work if shown in Search section of the app. Please take a look at that

@anhanh11001 anhanh11001 changed the title WIP - feat: Add speaker call submit proposal feature feat: Add create/load speaker profile for user May 31, 2019
@auto-label auto-label bot added the feature label May 31, 2019
@fossasia fossasia deleted a comment May 31, 2019
@fossasia fossasia deleted a comment May 31, 2019
@fossasia fossasia deleted a comment May 31, 2019
@anhanh11001
Copy link
Contributor Author

anhanh11001 commented May 31, 2019

Updated: Description above @liveHarshit Please review

var event: EventId? = null,
@ColumnInfo(index = true)
@Relationship("user")
var user: UserId? = null
Copy link
Member

Choose a reason for hiding this comment

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

These all should be value not variables, right?

Copy link
Member

@liveHarshit liveHarshit left a comment

Choose a reason for hiding this comment

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

Is email field editable?
And you can use progress dialog instead of progress bar from utils.

Details:
- Create fragment/ViewModel to create/get current speaker profile for fragment

Fixes: #1811
@anhanh11001
Copy link
Contributor Author

Updated, I have used progress dialog, it looks better; enable email editing (at first I thought the frontend set is as disabled); turned variables to values

@fossasia fossasia deleted a comment Jun 1, 2019
@fossasia fossasia deleted a comment Jun 1, 2019
@fossasia fossasia deleted a comment Jun 1, 2019
@fossasia fossasia deleted a comment Jun 1, 2019
@fossasia fossasia deleted a comment Jun 1, 2019
@fossasia fossasia deleted a comment Jun 1, 2019
| }, {
| 'name':'email',
| 'op':'eq',
| 'val':'${user.email}'
Copy link
Member

Choose a reason for hiding this comment

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

Why is the email thingy needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I followed the implementation in the frontend. It seems like the server allow a user to create multiple speaker's profiles, but only allow one email per profile.

dfs

@iamareebjamal
Copy link
Member

I think you can remove the email from the filter. Rest is fine

@iamareebjamal iamareebjamal merged commit 1db7a6c into fossasia:development Jun 1, 2019
@anhanh11001 anhanh11001 deleted the 1811_send_proposal branch June 20, 2019 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set up send proposal for Call for Speakers

4 participants