From a50afa208a188bd27091a4d1b2eda7f170e58880 Mon Sep 17 00:00:00 2001 From: Ben Outram Date: Tue, 3 Sep 2024 12:47:53 +0100 Subject: [PATCH] EES-4859 Correct data set id's and data set file id's used by API subscription pages --- .../Controllers/DataSetsControllerTests.cs | 1 + .../PublicationsControllerTests.cs | 1 + .../Services/DataSetService.cs | 1 + .../ViewModels/DataSetVersionViewModels.cs | 5 ++ .../ConfirmSubscriptionPage.tsx | 25 ++++---- .../ConfirmUnsubscriptionPage.tsx | 22 ++++--- .../api-subscriptions/NewSubscriptionPage.tsx | 13 ++-- .../ConfirmSubscriptionPage.test.tsx | 61 ++++++------------- .../ConfirmUnsubscriptionPage.test.tsx | 54 ++++++---------- .../__tests__/NewSubscriptionPage.test.tsx | 2 +- .../data-catalogue/__data__/testDataSets.ts | 3 + .../{[dataSetId].tsx => [dataSetFileId].tsx} | 0 .../src/services/apiDataSetService.ts | 3 + 13 files changed, 85 insertions(+), 106 deletions(-) rename src/explore-education-statistics-frontend/src/pages/api-subscriptions/new-subscription/{[dataSetId].tsx => [dataSetFileId].tsx} (100%) diff --git a/src/GovUk.Education.ExploreEducationStatistics.Public.Data.Api.Tests/Controllers/DataSetsControllerTests.cs b/src/GovUk.Education.ExploreEducationStatistics.Public.Data.Api.Tests/Controllers/DataSetsControllerTests.cs index 58e94351596..e733d1958e0 100644 --- a/src/GovUk.Education.ExploreEducationStatistics.Public.Data.Api.Tests/Controllers/DataSetsControllerTests.cs +++ b/src/GovUk.Education.ExploreEducationStatistics.Public.Data.Api.Tests/Controllers/DataSetsControllerTests.cs @@ -61,6 +61,7 @@ await TestApp.AddTestData(context => content.LatestVersion.Published ); Assert.Equal(dataSetVersion.TotalResults, content.LatestVersion.TotalResults); + Assert.Equal(dataSetVersion.Release.DataSetFileId, content.LatestVersion.File.Id); Assert.Equal( TimePeriodFormatter.FormatLabel( dataSetVersion.MetaSummary!.TimePeriodRange.Start.Period, diff --git a/src/GovUk.Education.ExploreEducationStatistics.Public.Data.Api.Tests/Controllers/PublicationsControllerTests.cs b/src/GovUk.Education.ExploreEducationStatistics.Public.Data.Api.Tests/Controllers/PublicationsControllerTests.cs index 83782e720f4..bc99ad83d1a 100644 --- a/src/GovUk.Education.ExploreEducationStatistics.Public.Data.Api.Tests/Controllers/PublicationsControllerTests.cs +++ b/src/GovUk.Education.ExploreEducationStatistics.Public.Data.Api.Tests/Controllers/PublicationsControllerTests.cs @@ -526,6 +526,7 @@ await TestApp.AddTestData(context => result.LatestVersion.Published ); Assert.Equal(dataSetVersion.TotalResults, result.LatestVersion.TotalResults); + Assert.Equal(dataSetVersion.Release.DataSetFileId, result.LatestVersion.File.Id); Assert.Equal( TimePeriodFormatter.FormatLabel( dataSetVersion.MetaSummary!.TimePeriodRange.Start.Period, diff --git a/src/GovUk.Education.ExploreEducationStatistics.Public.Data.Api/Services/DataSetService.cs b/src/GovUk.Education.ExploreEducationStatistics.Public.Data.Api/Services/DataSetService.cs index 155ef3ddec5..8e6b7caddb4 100644 --- a/src/GovUk.Education.ExploreEducationStatistics.Public.Data.Api/Services/DataSetService.cs +++ b/src/GovUk.Education.ExploreEducationStatistics.Public.Data.Api/Services/DataSetService.cs @@ -160,6 +160,7 @@ private static DataSetLatestVersionViewModel MapLatestVersion(DataSetVersion lat Version = latestVersion.PublicVersion, Published = latestVersion.Published!.Value, TotalResults = latestVersion.TotalResults, + File = MapFile(latestVersion), TimePeriods = MapTimePeriods(latestVersion.MetaSummary!.TimePeriodRange), GeographicLevels = latestVersion.MetaSummary.GeographicLevels, Filters = latestVersion.MetaSummary.Filters, diff --git a/src/GovUk.Education.ExploreEducationStatistics.Public.Data.Api/ViewModels/DataSetVersionViewModels.cs b/src/GovUk.Education.ExploreEducationStatistics.Public.Data.Api/ViewModels/DataSetVersionViewModels.cs index 007c9d2a43c..bd9f93c1705 100644 --- a/src/GovUk.Education.ExploreEducationStatistics.Public.Data.Api/ViewModels/DataSetVersionViewModels.cs +++ b/src/GovUk.Education.ExploreEducationStatistics.Public.Data.Api/ViewModels/DataSetVersionViewModels.cs @@ -114,6 +114,11 @@ public record DataSetLatestVersionViewModel /// public required long TotalResults { get; init; } + /// + /// The file that this data set version is based on. + /// + public required DataSetVersionFileViewModel File { get; init; } + /// /// The time period range covered by the data set. /// diff --git a/src/explore-education-statistics-frontend/src/modules/api-subscriptions/ConfirmSubscriptionPage.tsx b/src/explore-education-statistics-frontend/src/modules/api-subscriptions/ConfirmSubscriptionPage.tsx index 1c82d934e44..6283e2a7d25 100644 --- a/src/explore-education-statistics-frontend/src/modules/api-subscriptions/ConfirmSubscriptionPage.tsx +++ b/src/explore-education-statistics-frontend/src/modules/api-subscriptions/ConfirmSubscriptionPage.tsx @@ -5,8 +5,8 @@ import useToggle from '@common/hooks/useToggle'; import logger from '@common/services/logger'; import Page from '@frontend/components/Page'; import withAxiosHandler from '@frontend/middleware/ssr/withAxiosHandler'; -import { DataSetFile } from '@frontend/services/dataSetFileService'; -import dataSetFileQueries from '@frontend/queries/dataSetFileQueries'; +import { ApiDataSet } from '@frontend/services/apiDataSetService'; +import apiDataSetQueries from '@frontend/queries/apiDataSetQueries'; import Link from '@frontend/components/Link'; import apiNotificationService from '@frontend/services/apiNotificationService'; import { isAxiosError } from 'axios'; @@ -16,15 +16,16 @@ import Head from 'next/head'; import { QueryClient } from '@tanstack/react-query'; interface Props { - dataSetFile: DataSetFile; + dataSet: ApiDataSet; token: string; } -const ConfirmSubscriptionPage: NextPage = ({ dataSetFile, token }) => { +const ConfirmSubscriptionPage: NextPage = ({ dataSet, token }) => { const [submitted, toggleSubmitted] = useToggle(false); const [subscriptionError, setSubscriptionError] = useState(); - const { id: dataSetId, title } = dataSetFile; + const { id: dataSetId, title } = dataSet; + const dataSetFileId = dataSet.latestVersion.file.id; const onConfirm = async () => { try { @@ -53,7 +54,7 @@ const ConfirmSubscriptionPage: NextPage = ({ dataSetFile, token }) => {

Your subscription verification token has expired. You can try again by re-subscribing from the{' '} - + data set's main screen.

@@ -72,7 +73,7 @@ const ConfirmSubscriptionPage: NextPage = ({ dataSetFile, token }) => { <>

You are already subscribed to this data set.

- + View {title}

@@ -127,7 +128,7 @@ const ConfirmSubscriptionPage: NextPage = ({ dataSetFile, token }) => { { name: 'Data catalogue', link: '/data-catalogue' }, { name: title, - link: `/data-catalogue/data-set/${dataSetId}`, + link: `/data-catalogue/data-set/${dataSetFileId}`, }, ]} > @@ -138,7 +139,7 @@ const ConfirmSubscriptionPage: NextPage = ({ dataSetFile, token }) => {

You have successfully subscribed to these updates.

- + View {title}

@@ -162,13 +163,13 @@ export const getServerSideProps: GetServerSideProps = withAxiosHandler( const queryClient = new QueryClient(); - const dataSetFile = await queryClient.fetchQuery( - dataSetFileQueries.get(dataSetId), + const dataSet = await queryClient.fetchQuery( + apiDataSetQueries.getDataSet(dataSetId), ); return { props: { - dataSetFile, + dataSet, token, }, }; diff --git a/src/explore-education-statistics-frontend/src/modules/api-subscriptions/ConfirmUnsubscriptionPage.tsx b/src/explore-education-statistics-frontend/src/modules/api-subscriptions/ConfirmUnsubscriptionPage.tsx index fe07fd862ee..2dc016d9186 100644 --- a/src/explore-education-statistics-frontend/src/modules/api-subscriptions/ConfirmUnsubscriptionPage.tsx +++ b/src/explore-education-statistics-frontend/src/modules/api-subscriptions/ConfirmUnsubscriptionPage.tsx @@ -6,8 +6,8 @@ import logger from '@common/services/logger'; import Link from '@frontend/components/Link'; import Page from '@frontend/components/Page'; import withAxiosHandler from '@frontend/middleware/ssr/withAxiosHandler'; -import { DataSetFile } from '@frontend/services/dataSetFileService'; -import dataSetFileQueries from '@frontend/queries/dataSetFileQueries'; +import { ApiDataSet } from '@frontend/services/apiDataSetService'; +import apiDataSetQueries from '@frontend/queries/apiDataSetQueries'; import apiNotificationService from '@frontend/services/apiNotificationService'; import React, { useState } from 'react'; import { GetServerSideProps, NextPage } from 'next'; @@ -16,14 +16,16 @@ import { QueryClient } from '@tanstack/react-query'; import { isAxiosError } from 'axios'; interface Props { - dataSetFile: DataSetFile; + dataSet: ApiDataSet; token: string; } -const ConfirmUnsubscriptionPage: NextPage = ({ dataSetFile, token }) => { +const ConfirmUnsubscriptionPage: NextPage = ({ dataSet, token }) => { const [submitted, toggleSubmitted] = useToggle(false); const [unsubscribeError, setUnsubscribeError] = useState(); - const { id: dataSetId, title } = dataSetFile; + + const { id: dataSetId, title } = dataSet; + const dataSetFileId = dataSet.latestVersion.file.id; const onConfirm = async () => { try { @@ -96,7 +98,7 @@ const ConfirmUnsubscriptionPage: NextPage = ({ dataSetFile, token }) => { { name: 'Data catalogue', link: '/data-catalogue' }, { name: title, - link: `/data-catalogue/data-set/${dataSetId}`, + link: `/data-catalogue/data-set/${dataSetFileId}`, }, ]} > @@ -107,7 +109,7 @@ const ConfirmUnsubscriptionPage: NextPage = ({ dataSetFile, token }) => {

You have successfully unsubscribed from these updates.

- + View {title}

@@ -131,13 +133,13 @@ export const getServerSideProps: GetServerSideProps = withAxiosHandler( const queryClient = new QueryClient(); - const dataSetFile = await queryClient.fetchQuery( - dataSetFileQueries.get(dataSetId), + const dataSet = await queryClient.fetchQuery( + apiDataSetQueries.getDataSet(dataSetId), ); return { props: { - dataSetFile, + dataSet, token, }, }; diff --git a/src/explore-education-statistics-frontend/src/modules/api-subscriptions/NewSubscriptionPage.tsx b/src/explore-education-statistics-frontend/src/modules/api-subscriptions/NewSubscriptionPage.tsx index f228eb2643f..275073832a1 100644 --- a/src/explore-education-statistics-frontend/src/modules/api-subscriptions/NewSubscriptionPage.tsx +++ b/src/explore-education-statistics-frontend/src/modules/api-subscriptions/NewSubscriptionPage.tsx @@ -39,7 +39,8 @@ interface Props { } const NewSubscriptionPage: NextPage = ({ dataSetFile }) => { - const { id: dataSetId, title } = dataSetFile; + const { id: dataSetFileId, title } = dataSetFile; + const dataSetId = dataSetFile.api!.id; const handleFormSubmit = async ({ email }: FormValues) => { await apiNotificationService.requestPendingSubscription({ @@ -51,14 +52,14 @@ const NewSubscriptionPage: NextPage = ({ dataSetFile }) => { return ( @@ -70,7 +71,7 @@ const NewSubscriptionPage: NextPage = ({ dataSetFile }) => { enableReinitialize errorMappings={errorMappings} initialValues={{ - dataSetId: dataSetFile.id, + dataSetId, email: '', }} validationSchema={Yup.object({ @@ -120,12 +121,12 @@ const NewSubscriptionPage: NextPage = ({ dataSetFile }) => { export const getServerSideProps: GetServerSideProps = withAxiosHandler( async ({ query }) => { - const { dataSetId } = query as Dictionary; + const { dataSetFileId } = query as Dictionary; const queryClient = new QueryClient(); const dataSetFile = await queryClient.fetchQuery( - dataSetFileQueries.get(dataSetId), + dataSetFileQueries.get(dataSetFileId), ); return { diff --git a/src/explore-education-statistics-frontend/src/modules/api-subscriptions/__tests__/ConfirmSubscriptionPage.test.tsx b/src/explore-education-statistics-frontend/src/modules/api-subscriptions/__tests__/ConfirmSubscriptionPage.test.tsx index 63beb082c8f..fed86c74427 100644 --- a/src/explore-education-statistics-frontend/src/modules/api-subscriptions/__tests__/ConfirmSubscriptionPage.test.tsx +++ b/src/explore-education-statistics-frontend/src/modules/api-subscriptions/__tests__/ConfirmSubscriptionPage.test.tsx @@ -1,14 +1,14 @@ import render from '@common-test/render'; import createAxiosErrorMock from '@common-test/createAxiosErrorMock'; -import _dataSetFileService from '@frontend/services/dataSetFileService'; +import _apiDataSetService from '@frontend/services/apiDataSetService'; import _apiNotificationService from '@frontend/services/apiNotificationService'; -import { testDataSetWithApi } from '@frontend/modules/data-catalogue/__data__/testDataSets'; +import { testApiDataSet } from '@frontend/modules/data-catalogue/__data__/testDataSets'; import ConfirmSubscriptionPage from '@frontend/modules/api-subscriptions/ConfirmSubscriptionPage'; import { screen, waitFor } from '@testing-library/react'; -jest.mock('@frontend/services/dataSetFileService'); -const dataSetFileService = _dataSetFileService as jest.Mocked< - typeof _dataSetFileService +jest.mock('@frontend/services/apiDataSetService'); +const apiDataSetService = _apiDataSetService as jest.Mocked< + typeof _apiDataSetService >; jest.mock('@frontend/services/apiNotificationService'); @@ -18,19 +18,16 @@ const apiNotificationService = _apiNotificationService as jest.Mocked< describe('ConfirmSubscriptionPage', () => { beforeEach(() => { - dataSetFileService.getDataSetFile.mockResolvedValue(testDataSetWithApi); + apiDataSetService.getDataSet.mockResolvedValue(testApiDataSet); }); test('renders correctly', () => { render( - , + , ); expect( - screen.getByRole('heading', { name: 'Data set 1' }), + screen.getByRole('heading', { name: 'Test title' }), ).toBeInTheDocument(); expect( @@ -43,10 +40,7 @@ describe('ConfirmSubscriptionPage', () => { test('successful confirmation', async () => { const { user } = render( - , + , ); await user.click(screen.getByRole('button', { name: 'Confirm' })); @@ -54,7 +48,7 @@ describe('ConfirmSubscriptionPage', () => { await waitFor(() => { expect( apiNotificationService.confirmPendingSubscription, - ).toHaveBeenCalledWith('data-set-file-id', 'test-token'); + ).toHaveBeenCalledWith('api-data-set-id', 'test-token'); }); expect( @@ -73,10 +67,7 @@ describe('ConfirmSubscriptionPage', () => { }); apiNotificationService.confirmPendingSubscription.mockRejectedValue(error); const { user } = render( - , + , ); await user.click(screen.getByRole('button', { name: 'Confirm' })); @@ -84,7 +75,7 @@ describe('ConfirmSubscriptionPage', () => { await waitFor(() => { expect( apiNotificationService.confirmPendingSubscription, - ).toHaveBeenCalledWith('data-set-file-id', 'test-token'); + ).toHaveBeenCalledWith('api-data-set-id', 'test-token'); }); expect( @@ -112,10 +103,7 @@ describe('ConfirmSubscriptionPage', () => { }); apiNotificationService.confirmPendingSubscription.mockRejectedValue(error); const { user } = render( - , + , ); await user.click(screen.getByRole('button', { name: 'Confirm' })); @@ -123,7 +111,7 @@ describe('ConfirmSubscriptionPage', () => { await waitFor(() => { expect( apiNotificationService.confirmPendingSubscription, - ).toHaveBeenCalledWith('data-set-file-id', 'test-token'); + ).toHaveBeenCalledWith('api-data-set-id', 'test-token'); }); expect( @@ -151,10 +139,7 @@ describe('ConfirmSubscriptionPage', () => { }); apiNotificationService.confirmPendingSubscription.mockRejectedValue(error); const { user } = render( - , + , ); await user.click(screen.getByRole('button', { name: 'Confirm' })); @@ -162,7 +147,7 @@ describe('ConfirmSubscriptionPage', () => { await waitFor(() => { expect( apiNotificationService.confirmPendingSubscription, - ).toHaveBeenCalledWith('data-set-file-id', 'test-token'); + ).toHaveBeenCalledWith('api-data-set-id', 'test-token'); }); expect( @@ -189,10 +174,7 @@ describe('ConfirmSubscriptionPage', () => { }); apiNotificationService.confirmPendingSubscription.mockRejectedValue(error); const { user } = render( - , + , ); await user.click(screen.getByRole('button', { name: 'Confirm' })); @@ -200,7 +182,7 @@ describe('ConfirmSubscriptionPage', () => { await waitFor(() => { expect( apiNotificationService.confirmPendingSubscription, - ).toHaveBeenCalledWith('data-set-file-id', 'test-token'); + ).toHaveBeenCalledWith('api-data-set-id', 'test-token'); }); expect( @@ -226,10 +208,7 @@ describe('ConfirmSubscriptionPage', () => { }); apiNotificationService.confirmPendingSubscription.mockRejectedValue(error); const { user } = render( - , + , ); await user.click(screen.getByRole('button', { name: 'Confirm' })); @@ -237,7 +216,7 @@ describe('ConfirmSubscriptionPage', () => { await waitFor(() => { expect( apiNotificationService.confirmPendingSubscription, - ).toHaveBeenCalledWith('data-set-file-id', 'test-token'); + ).toHaveBeenCalledWith('api-data-set-id', 'test-token'); }); expect( diff --git a/src/explore-education-statistics-frontend/src/modules/api-subscriptions/__tests__/ConfirmUnsubscriptionPage.test.tsx b/src/explore-education-statistics-frontend/src/modules/api-subscriptions/__tests__/ConfirmUnsubscriptionPage.test.tsx index 225364cf6ba..ccd6b37805d 100644 --- a/src/explore-education-statistics-frontend/src/modules/api-subscriptions/__tests__/ConfirmUnsubscriptionPage.test.tsx +++ b/src/explore-education-statistics-frontend/src/modules/api-subscriptions/__tests__/ConfirmUnsubscriptionPage.test.tsx @@ -1,14 +1,14 @@ import render from '@common-test/render'; import createAxiosErrorMock from '@common-test/createAxiosErrorMock'; -import _dataSetFileService from '@frontend/services/dataSetFileService'; +import _apiDataSetService from '@frontend/services/apiDataSetService'; import _apiNotificationService from '@frontend/services/apiNotificationService'; -import { testDataSetWithApi } from '@frontend/modules/data-catalogue/__data__/testDataSets'; +import { testApiDataSet } from '@frontend/modules/data-catalogue/__data__/testDataSets'; import ConfirmUnsubscriptionPage from '@frontend/modules/api-subscriptions/ConfirmUnsubscriptionPage'; import { screen, waitFor } from '@testing-library/react'; -jest.mock('@frontend/services/dataSetFileService'); -const dataSetFileService = _dataSetFileService as jest.Mocked< - typeof _dataSetFileService +jest.mock('@frontend/services/apiDataSetService'); +const apiDataSetService = _apiDataSetService as jest.Mocked< + typeof _apiDataSetService >; jest.mock('@frontend/services/apiNotificationService'); @@ -18,19 +18,16 @@ const apiNotificationService = _apiNotificationService as jest.Mocked< describe('ConfirmUnsubscriptionPage', () => { beforeEach(() => { - dataSetFileService.getDataSetFile.mockResolvedValue(testDataSetWithApi); + apiDataSetService.getDataSet.mockResolvedValue(testApiDataSet); }); test('renders correctly', () => { render( - , + , ); expect( - screen.getByRole('heading', { name: 'Data set 1' }), + screen.getByRole('heading', { name: 'Test title' }), ).toBeInTheDocument(); expect( @@ -43,17 +40,14 @@ describe('ConfirmUnsubscriptionPage', () => { test('successful confirmation', async () => { const { user } = render( - , + , ); await user.click(screen.getByRole('button', { name: 'Confirm' })); await waitFor(() => { expect(apiNotificationService.confirmUnsubscription).toHaveBeenCalledWith( - 'data-set-file-id', + 'api-data-set-id', 'test-token', ); }); @@ -74,17 +68,14 @@ describe('ConfirmUnsubscriptionPage', () => { }); apiNotificationService.confirmUnsubscription.mockRejectedValue(error); const { user } = render( - , + , ); await user.click(screen.getByRole('button', { name: 'Confirm' })); await waitFor(() => { expect(apiNotificationService.confirmUnsubscription).toHaveBeenCalledWith( - 'data-set-file-id', + 'api-data-set-id', 'test-token', ); }); @@ -114,17 +105,14 @@ describe('ConfirmUnsubscriptionPage', () => { }); apiNotificationService.confirmUnsubscription.mockRejectedValue(error); const { user } = render( - , + , ); await user.click(screen.getByRole('button', { name: 'Confirm' })); await waitFor(() => { expect(apiNotificationService.confirmUnsubscription).toHaveBeenCalledWith( - 'data-set-file-id', + 'api-data-set-id', 'test-token', ); }); @@ -150,17 +138,14 @@ describe('ConfirmUnsubscriptionPage', () => { const error = createAxiosErrorMock({ data: '', status: 404 }); apiNotificationService.confirmUnsubscription.mockRejectedValue(error); const { user } = render( - , + , ); await user.click(screen.getByRole('button', { name: 'Confirm' })); await waitFor(() => { expect(apiNotificationService.confirmUnsubscription).toHaveBeenCalledWith( - 'data-set-file-id', + 'api-data-set-id', 'test-token', ); }); @@ -186,17 +171,14 @@ describe('ConfirmUnsubscriptionPage', () => { const error = createAxiosErrorMock({ data: '', status: 500 }); apiNotificationService.confirmUnsubscription.mockRejectedValue(error); const { user } = render( - , + , ); await user.click(screen.getByRole('button', { name: 'Confirm' })); await waitFor(() => { expect(apiNotificationService.confirmUnsubscription).toHaveBeenCalledWith( - 'data-set-file-id', + 'api-data-set-id', 'test-token', ); }); diff --git a/src/explore-education-statistics-frontend/src/modules/api-subscriptions/__tests__/NewSubscriptionPage.test.tsx b/src/explore-education-statistics-frontend/src/modules/api-subscriptions/__tests__/NewSubscriptionPage.test.tsx index bf67c0fa6b2..c874c0d7729 100644 --- a/src/explore-education-statistics-frontend/src/modules/api-subscriptions/__tests__/NewSubscriptionPage.test.tsx +++ b/src/explore-education-statistics-frontend/src/modules/api-subscriptions/__tests__/NewSubscriptionPage.test.tsx @@ -73,7 +73,7 @@ describe('NewSubscriptionPage', () => { apiNotificationService.requestPendingSubscription, ).toHaveBeenLastCalledWith({ email: 'user@test.com', - dataSetId: 'data-set-file-id', + dataSetId: 'api-data-set-id', dataSetTitle: 'Data set 1', }); diff --git a/src/explore-education-statistics-frontend/src/modules/data-catalogue/__data__/testDataSets.ts b/src/explore-education-statistics-frontend/src/modules/data-catalogue/__data__/testDataSets.ts index 8fab66d856a..c73c983240c 100644 --- a/src/explore-education-statistics-frontend/src/modules/data-catalogue/__data__/testDataSets.ts +++ b/src/explore-education-statistics-frontend/src/modules/data-catalogue/__data__/testDataSets.ts @@ -296,5 +296,8 @@ export const testApiDataSet: ApiDataSet = { geographicLevels: [], filters: [], indicators: [], + file: { + id: 'data-set-file-id', + }, }, }; diff --git a/src/explore-education-statistics-frontend/src/pages/api-subscriptions/new-subscription/[dataSetId].tsx b/src/explore-education-statistics-frontend/src/pages/api-subscriptions/new-subscription/[dataSetFileId].tsx similarity index 100% rename from src/explore-education-statistics-frontend/src/pages/api-subscriptions/new-subscription/[dataSetId].tsx rename to src/explore-education-statistics-frontend/src/pages/api-subscriptions/new-subscription/[dataSetFileId].tsx diff --git a/src/explore-education-statistics-frontend/src/services/apiDataSetService.ts b/src/explore-education-statistics-frontend/src/services/apiDataSetService.ts index 14c58ce7701..f9e11b38e91 100644 --- a/src/explore-education-statistics-frontend/src/services/apiDataSetService.ts +++ b/src/explore-education-statistics-frontend/src/services/apiDataSetService.ts @@ -21,6 +21,9 @@ export interface ApiDataSet { geographicLevels: string[]; filters: string[]; indicators: string[]; + file: { + id: string; + }; }; }