Skip to content

EVENTS: API inkludieren der URL von Anhängen #1873

Description

@mtnstar

Der API Endpoint eines einzelnen Events soll neu die URL von Anhängen mitliefern.

"events": [
    {   
      "id": "42",
      "type": "events",
      "name": "Camp",
      "description": "Camp d'été",
      "motto": null,
      "cost": "270",
      "maximum_participants": 3,
      "participant_count": 3,
      "location": "1000 Lauanne",
      "application_opening_at": "2020-03-01",
      "application_closing_at": "2020-04-08",
      "application_conditions": null,
      "state": null,
      "teamer_count": 0,
      "external_application_link": "https://hitobito.example.com/de/groups/42/public_events/33",
      "attachments": [
         { "file_name": "test.png", 
            "url": "https://hitobito.example.com/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzcJBaHBFQT09IiwiZXhwxsLCJwdXIiOiJibG9iX2lkIn19--1fe9519b42bd2b94f7629b3ef5e176b5fb39f2d6/test.png"},
      ...],
      "links": {
        "dates": [
          "62"
        ],  
        "groups": [
          "32"
        ]   
      },  
      "tags": []
      ]
    }

Erstellt aus SBV Issue

Tech-Spec

ToDo

  • Serializer für Attachment erstellen
    • file_name, url als attribute ausgeben (keine id)
    • den active storage link von rails in der url ausgeben (inkl. fqdn und protokoll/https)
  • Event Serializer mit Attachments ergänzen für events#show.json
  • Sicherstellen das bei events#index keine Anhänge mitgeliefert werden
  • EventsController specs ergänzen
  • JSON im Browser testen
  • CHANGELOG-Eintrag unter "unreleased" unten hinzufügen

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions