fossasia / open-event-server

The Open Event Organizer Server to Manage Events https://test-api.eventyay.com
https://api.eventyay.com
GNU General Public License v3.0
2.97k stars 1.89k forks source link

Urls like original-image-url get changed after creating events using API #5307

Closed dreadpool2 closed 5 years ago

dreadpool2 commented 6 years ago

Describe the bug Urls like originial-image-urlare getting changed in the response shown after using POST request to create them. API used api.eventyay.com/v1/events. Below is the event to be posted raw data and corresponding response.

Event to be posted:-

{
  "data": {
    "attributes": {
      "name": "Music & Voice Therapy with Michele Chong",
      "external-event-url": "http://example.com",
      "starts-at": "2018-10-12T23:59:59.123456+00:00",
      "ends-at": "2018-10-20T23:59:59.123456+00:00",
      "timezone": "UTC",
      "latitude": "1.29456789",
      "longitude": "103.85",
      "logo-url": "https://upload.wikimedia.org/wikipedia/commons/8/88/Music-segno.png",
      "location-name": "Raffles Place, Singapore",
      "searchable-location-name": "Singapore",
      "description": "An oft cited notable example of the dilemma in defining music is a work entitled 4'33'' (1952) by the American composer John Cage (1912–1992). The written score has three movements and directs the performer(s) to appear on stage, indicate by gesture or other means when the piece begins, then make no sound and only mark sections and the end by gesture. What is heard are only whatever ambient sounds may occur in the room. Some argue this is not music because, for example, it contains no sounds that are conventionally considered musical",
      "original-image-url": "https://steemitimages.com/DQmWG96SKvDEx98pB4T34CB7UqgkZDRawHNaDsoETzLmQ57/1240e483-c8b9-4d0d-8b48-c8c245f2c05e.jpg",
      "organizer-name": "Musical Organizers",
      "is-map-shown": "true",
      "organizer-description": "Good Organizer!",
      "is-sessions-speakers-enabled": "true",
      "privacy": "public",
      "state": "draft",
      "average-rating": null,
      "ticket-url": "http://example.com",
      "code-of-conduct": "example",
      "is-ticketing-enabled": "true",
      "payment-country": "US",
      "payment-currency": "USD",
      "paypal-email": "example@example.com",
      "is-tax-enabled": "true",
      "can-pay-by-paypal": "true",
      "can-pay-by-stripe": "true",
      "can-pay-by-cheque": "true",
      "can-pay-by-bank": "true",
      "can-pay-onsite": "true",
      "cheque-details": "example",
      "bank-details": "example",
      "onsite-details": "example",
      "is-sponsors-enabled": "false",
      "has-organizer-info": "false",
      "order-expiry-time": "10"
    },
    "type": "event"
  }
}

Response:-

{
    "data": {
        "type": "event",
        "attributes": {
            "can-pay-by-stripe": true,
            "organizer-description": "Good Organizer!",
            "schedule-published-on": null,
            "cheque-details": "example",
            "state": "draft",
            "thumbnail-image-url": "http://localhost:5000/static/media/events/11/thumbnail/aGdud2NMcT/c1449a43-ca6b-42c3-ada7-e357ac6b21b5.jpg",
            "location-name": "Raffles Place, Singapore",
            "organizer-name": "Musical Organizers",
            "can-pay-by-bank": true,
            "starts-at": "2018-10-12T23:59:59.123456+00:00",
            "timezone": "UTC",
            "is-sponsors-enabled": false,
            "can-pay-by-paypal": true,
            "large-image-url": "http://localhost:5000/static/media/events/11/large/QXN6enM3Nj/f3ddb7c7-f036-443f-aca6-feb18a968a03.jpg",
            "has-organizer-info": false,
            "is-map-shown": true,
            "original-image-url": "http://localhost:5000/static/media/events/11/original/cFlISFBQb2/2eeef3bc-5b24-4b25-a094-616ced922432.jpg",
            "ticket-url": "http://example.com",
            "icon-image-url": "http://localhost:5000/static/media/events/11/icon/cFhCcnBiRV/fc2d8186-c9ff-4fc7-a723-87a21c34808d.jpg",
            "xcal-url": null,
            "onsite-details": "example",
            "average-rating": null,
            "identifier": "b5f87a50",
            "latitude": 1.29456789,
            "is-sessions-speakers-enabled": true,
            "pentabarf-url": null,
            "code-of-conduct": "example",
            "is-ticketing-enabled": true,
            "bank-details": "example",
            "longitude": 103.85,
            "external-event-url": "http://example.com",
            "ical-url": null,
            "searchable-location-name": "Singapore",
            "can-pay-by-cheque": true,
            "paypal-email": "example@example.com",
            "ends-at": "2018-10-20T23:59:59.123456+00:00",
            "privacy": "public",
            "payment-currency": "USD",
            "name": "Music & Voice Therapy with Michele Chong",
            "deleted-at": null,
            "logo-url": "https://upload.wikimedia.org/wikipedia/commons/8/88/Music-segno.png",
            "is-tax-enabled": true,
            "payment-country": "US",
            "can-pay-onsite": true,
            "description": "An oft cited notable example of the dilemma in defining music is a work entitled 4'33'' (1952) by the American composer John Cage (1912–1992). The written score has three movements and directs the performer(s) to appear on stage, indicate by gesture or other means when the piece begins, then make no sound and only mark sections and the end by gesture. What is heard are only whatever ambient sounds may occur in the room. Some argue this is not music because, for example, it contains no sounds that are conventionally considered musical",
            "created-at": "2018-08-07T15:27:14.583517+00:00"
        },
        "relationships": {
            "tickets": {
                "links": {
                    "self": "/v1/events/11/relationships/tickets",
                    "related": "/v1/events/11/tickets"
                }
            },
            "sessions": {
                "links": {
                    "self": "/v1/events/11/relationships/sessions",
                    "related": "/v1/events/11/sessions"
                }
            },
            "speakers": {
                "links": {
                    "self": "/v1/events/11/relationships/speakers",
                    "related": "/v1/events/11/speakers"
                }
            },
            "moderators": {
                "links": {
                    "self": "/v1/events/11/relationships/moderators",
                    "related": "/v1/users"
                }
            },
            "registrars": {
                "links": {
                    "self": "/v1/events/11/relationships/registrars",
                    "related": "/v1/users"
                }
            },
            "event-topic": {
                "links": {
                    "self": "/v1/events/11/relationships/event-topic",
                    "related": "/v1/events/11/event-topic"
                }
            },
            "stripe-authorization": {
                "links": {
                    "self": "/v1/stripe-authorizations/11/relationships/event",
                    "related": "/v1/events/11/stripe-authorization"
                }
            },
            "role-invites": {
                "links": {
                    "self": "/v1/events/11/relationships/role-invites",
                    "related": "/v1/events/11/role-invites"
                }
            },
            "orders": {
                "links": {
                    "self": "/v1/events/11/relationships/orders",
                    "related": "/v1/events/11/orders"
                }
            },
            "sponsors": {
                "links": {
                    "self": "/v1/events/11/relationships/sponsors",
                    "related": "/v1/events/11/sponsors"
                }
            },
            "discount-codes": {
                "links": {
                    "self": "/v1/events/11/relationships/discount-codes",
                    "related": "/v1/events/11/discount-codes"
                }
            },
            "event-sub-topic": {
                "links": {
                    "self": "/v1/events/11/relationships/event-sub-topic",
                    "related": "/v1/events/11/event-sub-topic"
                }
            },
            "social-links": {
                "links": {
                    "self": "/v1/events/11/relationships/social-links",
                    "related": "/v1/events/11/social-links"
                }
            },
            "event-type": {
                "links": {
                    "self": "/v1/events/11/relationships/event-type",
                    "related": "/v1/events/11/event-type"
                }
            },
            "event-invoices": {
                "links": {
                    "self": "/v1/events/11/relationships/event-invoices",
                    "related": "/v1/events/11/event-invoices"
                }
            },
            "access-codes": {
                "links": {
                    "self": "/v1/events/11/relationships/access-codes",
                    "related": "/v1/events/11/access-codes"
                }
            },
            "faq-types": {
                "links": {
                    "self": "/v1/events/11/relationships/faq-types",
                    "related": "/v1/events/11/faq-types"
                }
            },
            "speakers-call": {
                "links": {
                    "self": "/v1/events/11/relationships/speakers-call",
                    "related": "/v1/events/11/speakers-call"
                }
            },
            "faqs": {
                "links": {
                    "self": "/v1/events/11/relationships/faqs",
                    "related": "/v1/events/11/faqs"
                }
            },
            "tax": {
                "links": {
                    "self": "/v1/events/11/relationships/tax",
                    "related": "/v1/events/11/tax"
                }
            },
            "event-copyright": {
                "links": {
                    "self": "/v1/events/11/relationships/event-copyright",
                    "related": "/v1/events/11/event-copyright"
                }
            },
            "custom-forms": {
                "links": {
                    "self": "/v1/events/11/relationships/custom-forms",
                    "related": "/v1/events/11/custom-forms"
                }
            },
            "attendees": {
                "links": {
                    "self": "/v1/events/11/relationships/attendees",
                    "related": "/v1/events/11/attendees"
                }
            },
            "tracks": {
                "links": {
                    "self": "/v1/events/11/relationships/tracks",
                    "related": "/v1/events/11/tracks"
                }
            },
            "ticket-tags": {
                "links": {
                    "self": "/v1/events/11/relationships/ticket-tags",
                    "related": "/v1/events/11/ticket-tags"
                }
            },
            "coorganizers": {
                "links": {
                    "self": "/v1/events/11/relationships/coorganizers",
                    "related": "/v1/users"
                }
            },
            "feedbacks": {
                "links": {
                    "self": "/v1/events/11/relationships/feedbacks",
                    "related": "/v1/events/11/feedbacks"
                }
            },
            "track-organizers": {
                "links": {
                    "self": "/v1/events/11/relationships/track-organizers",
                    "related": "/v1/users"
                }
            },
            "microlocations": {
                "links": {
                    "self": "/v1/events/11/relationships/microlocations",
                    "related": "/v1/events/11/microlocations"
                }
            },
            "organizers": {
                "links": {
                    "self": "/v1/events/11/relationships/organizers",
                    "related": "/v1/users"
                }
            },
            "session-types": {
                "links": {
                    "self": "/v1/events/11/relationships/session-types",
                    "related": "/v1/events/11/session-types"
                }
            }
        },
        "id": "11",
        "links": {
            "self": "/v1/events/11"
        }
    },
    "links": {
        "self": "/v1/events/11"
    },
    "jsonapi": {
        "version": "1.0"
    }
}
bhaveshAn commented 6 years ago

Not a issue. It is because after getting the image url it first sets it into different sizes and get stored in static directory. And then fetches the url of local image in static dir.

dreadpool2 commented 6 years ago

But then how can we show these images in the app? As these links depend on local host

dreadpool2 commented 6 years ago

@bhaveshAn It's working perfectly fine when we use api https://open-event-api-dev.herokuapp.com/v1/events but not when api.eventyay.com/v1/events is used

bhaveshAn commented 6 years ago

Check http://api.eventyay.com/static/media/events/11/icon/cFhCcnBiRV/fc2d8186-c9ff-4fc7-a723-87a21c34808d.jpg

bhaveshAn commented 6 years ago

Changing localhost:5000 to api.eventyay.com works

dreadpool2 commented 6 years ago

Yeah! exactly. That's the image.

dreadpool2 commented 6 years ago

Isn't it a server bug then? You are returning the correct url while using the heroku API but not while using eventyay API? Do correct me if I am wrong.

bhaveshAn commented 6 years ago

You are right. Do you wanna work on this ??

dreadpool2 commented 6 years ago

@bhaveshAn You can go ahead on this issue if you want:+1:

bhaveshAn commented 6 years ago

Sure !

iamareebjamal commented 5 years ago

This is still a concern AFAIK

uds5501 commented 5 years ago

@iamareebjamal will #5330 resolve the issue?

iamareebjamal commented 5 years ago

But it is closed. If the issue it was addressing is fixed, then yes

prateekj117 commented 5 years ago

Not reproducible anymore. @iamareebjamal @uds5501 Let's close this.