Skip to content

Commit

Permalink
(PC-31759)[API] feat: add params to log offer list view in adage
Browse files Browse the repository at this point in the history
  • Loading branch information
smokhtari-passculture committed Sep 20, 2024
1 parent c285eec commit daa12c0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/src/pcapi/routes/adage_iframe/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def log_offer_list_view_switch(
"source": body.source,
"from": body.iframeFrom,
"queryId": body.queryId,
"isMobile": body.isMobile,
},
uai=authenticated_information.uai,
user_role=AdageFrontRoles.REDACTOR if institution else AdageFrontRoles.READONLY,
Expand Down
1 change: 1 addition & 0 deletions api/src/pcapi/routes/adage_iframe/serialization/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class AdagePlaylistType(enum.Enum):

class OfferListSwitch(AdageBaseModel):
source: str
isMobile: bool | None


class CatalogViewBody(AdageBaseModel):
Expand Down
3 changes: 2 additions & 1 deletion api/tests/routes/adage_iframe/post_logs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_log_offer_list_view_switch(self, test_client, caplog):
with caplog.at_level(logging.INFO):
response = test_client.post(
url_for("adage_iframe.log_offer_list_view_switch"),
json={"source": "offer_switch", "iframeFrom": "playlist", "queryId": "1234"},
json={"source": "offer_switch", "iframeFrom": "playlist", "queryId": "1234", "isMobile": True},
)

assert response.status_code == 204
Expand All @@ -51,6 +51,7 @@ def test_log_offer_list_view_switch(self, test_client, caplog):
"analyticsSource": "adage",
"source": "offer_switch",
"queryId": "1234",
"isMobile": True,
"from": "playlist",
"uai": UAI,
"user_role": AdageFrontRoles.READONLY,
Expand Down
1 change: 1 addition & 0 deletions pro/src/apiClient/adage/models/OfferListSwitch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
export type OfferListSwitch = {
iframeFrom: string;
isFromNoResult?: boolean | null;
isMobile?: boolean | null;
queryId?: string | null;
source: string;
};
Expand Down

0 comments on commit daa12c0

Please sign in to comment.