API & Client - rename data export endpoints

This commit is contained in:
Sam 2023-03-05 10:30:26 +01:00
parent 4aed07d458
commit 65a8ae0ae7
4 changed files with 22 additions and 22 deletions

View File

@ -2845,7 +2845,7 @@ class TestPostUserDataExportRequest(ApiTestCaseMixin):
) )
response = client.post( response = client.post(
'/api/auth/profile/export/request', '/api/auth/account/export/request',
content_type='application/json', content_type='application/json',
headers=dict(Authorization=f'Bearer {auth_token}'), headers=dict(Authorization=f'Bearer {auth_token}'),
) )
@ -2871,7 +2871,7 @@ class TestPostUserDataExportRequest(ApiTestCaseMixin):
) )
response = client.post( response = client.post(
'/api/auth/profile/export/request', '/api/auth/account/export/request',
content_type='application/json', content_type='application/json',
headers=dict(Authorization=f'Bearer {auth_token}'), headers=dict(Authorization=f'Bearer {auth_token}'),
) )
@ -2893,7 +2893,7 @@ class TestPostUserDataExportRequest(ApiTestCaseMixin):
) )
response = client.post( response = client.post(
'/api/auth/profile/export/request', '/api/auth/account/export/request',
content_type='application/json', content_type='application/json',
headers=dict(Authorization=f'Bearer {auth_token}'), headers=dict(Authorization=f'Bearer {auth_token}'),
) )
@ -2919,7 +2919,7 @@ class TestPostUserDataExportRequest(ApiTestCaseMixin):
) )
response = client.post( response = client.post(
'/api/auth/profile/export/request', '/api/auth/account/export/request',
content_type='application/json', content_type='application/json',
headers=dict(Authorization=f'Bearer {auth_token}'), headers=dict(Authorization=f'Bearer {auth_token}'),
) )
@ -2944,7 +2944,7 @@ class TestPostUserDataExportRequest(ApiTestCaseMixin):
) )
client.post( client.post(
'/api/auth/profile/export/request', '/api/auth/account/export/request',
content_type='application/json', content_type='application/json',
headers=dict(Authorization=f'Bearer {auth_token}'), headers=dict(Authorization=f'Bearer {auth_token}'),
) )
@ -2974,7 +2974,7 @@ class TestPostUserDataExportRequest(ApiTestCaseMixin):
) )
client.post( client.post(
'/api/auth/profile/export/request', '/api/auth/account/export/request',
content_type='application/json', content_type='application/json',
headers=dict(Authorization=f'Bearer {auth_token}'), headers=dict(Authorization=f'Bearer {auth_token}'),
) )
@ -3000,7 +3000,7 @@ class TestPostUserDataExportRequest(ApiTestCaseMixin):
) )
client.post( client.post(
'/api/auth/profile/export/request', '/api/auth/account/export/request',
content_type='application/json', content_type='application/json',
headers=dict(Authorization=f'Bearer {auth_token}'), headers=dict(Authorization=f'Bearer {auth_token}'),
) )
@ -3025,7 +3025,7 @@ class TestGetUserDataExportRequest(ApiTestCaseMixin):
) )
response = client.get( response = client.get(
'/api/auth/profile/export', '/api/auth/account/export',
content_type='application/json', content_type='application/json',
headers=dict(Authorization=f'Bearer {auth_token}'), headers=dict(Authorization=f'Bearer {auth_token}'),
) )
@ -3053,7 +3053,7 @@ class TestGetUserDataExportRequest(ApiTestCaseMixin):
) )
response = client.get( response = client.get(
'/api/auth/profile/export', '/api/auth/account/export',
content_type='application/json', content_type='application/json',
headers=dict(Authorization=f'Bearer {auth_token}'), headers=dict(Authorization=f'Bearer {auth_token}'),
) )
@ -3075,7 +3075,7 @@ class TestDownloadExportDataArchive(ApiTestCaseMixin):
) )
response = client.get( response = client.get(
f'/api/auth/profile/export/{self.random_string()}', f'/api/auth/account/export/{self.random_string()}',
headers=dict(Authorization=f'Bearer {auth_token}'), headers=dict(Authorization=f'Bearer {auth_token}'),
) )
@ -3095,7 +3095,7 @@ class TestDownloadExportDataArchive(ApiTestCaseMixin):
) )
response = client.get( response = client.get(
f'/api/auth/profile/export/{archive_file_name}', f'/api/auth/account/export/{archive_file_name}',
headers=dict(Authorization=f'Bearer {auth_token}'), headers=dict(Authorization=f'Bearer {auth_token}'),
) )
@ -3114,7 +3114,7 @@ class TestDownloadExportDataArchive(ApiTestCaseMixin):
) )
response = client.get( response = client.get(
f'/api/auth/profile/export/{self.random_string()}', f'/api/auth/account/export/{self.random_string()}',
headers=dict(Authorization=f'Bearer {auth_token}'), headers=dict(Authorization=f'Bearer {auth_token}'),
) )
@ -3136,7 +3136,7 @@ class TestDownloadExportDataArchive(ApiTestCaseMixin):
mock.return_value = 'file' mock.return_value = 'file'
client.get( client.get(
f'/api/auth/profile/export/{archive_file_name}', f'/api/auth/account/export/{archive_file_name}',
headers=dict(Authorization=f'Bearer {auth_token}'), headers=dict(Authorization=f'Bearer {auth_token}'),
) )

View File

@ -1688,7 +1688,7 @@ def accept_privacy_policy(auth_user: User) -> Union[Dict, HttpResponse]:
return handle_error_and_return_response(e, db=db) return handle_error_and_return_response(e, db=db)
@auth_blueprint.route('/auth/profile/export/request', methods=['POST']) @auth_blueprint.route('/auth/account/export/request', methods=['POST'])
@require_auth() @require_auth()
def request_user_data_export(auth_user: User) -> Union[Dict, HttpResponse]: def request_user_data_export(auth_user: User) -> Union[Dict, HttpResponse]:
""" """
@ -1698,7 +1698,7 @@ def request_user_data_export(auth_user: User) -> Union[Dict, HttpResponse]:
.. sourcecode:: http .. sourcecode:: http
POST /auth/profile/export/request HTTP/1.1 POST /auth/account/export/request HTTP/1.1
Content-Type: application/json Content-Type: application/json
**Example response**: **Example response**:
@ -1761,7 +1761,7 @@ def request_user_data_export(auth_user: User) -> Union[Dict, HttpResponse]:
return handle_error_and_return_response(e, db=db) return handle_error_and_return_response(e, db=db)
@auth_blueprint.route('/auth/profile/export', methods=['GET']) @auth_blueprint.route('/auth/account/export', methods=['GET'])
@require_auth() @require_auth()
def get_user_data_export(auth_user: User) -> Union[Dict, HttpResponse]: def get_user_data_export(auth_user: User) -> Union[Dict, HttpResponse]:
""" """
@ -1777,7 +1777,7 @@ def get_user_data_export(auth_user: User) -> Union[Dict, HttpResponse]:
.. sourcecode:: http .. sourcecode:: http
GET /auth/profile/export HTTP/1.1 GET /auth/account/export HTTP/1.1
Content-Type: application/json Content-Type: application/json
**Example response**: **Example response**:
@ -1829,7 +1829,7 @@ def get_user_data_export(auth_user: User) -> Union[Dict, HttpResponse]:
@auth_blueprint.route( @auth_blueprint.route(
'/auth/profile/export/<string:file_name>', methods=['GET'] '/auth/account/export/<string:file_name>', methods=['GET']
) )
@require_auth() @require_auth()
def download_data_export( def download_data_export(
@ -1842,7 +1842,7 @@ def download_data_export(
.. sourcecode:: http .. sourcecode:: http
GET /auth/profile/export/download/archive_rgjsR3fHr5Yp.zip HTTP/1.1 GET /auth/account/export/download/archive_rgjsR3fHr5Yp.zip HTTP/1.1
Content-Type: application/json Content-Type: application/json
**Example response**: **Example response**:

View File

@ -212,7 +212,7 @@
async function downloadArchive(filename: string) { async function downloadArchive(filename: string) {
generatingLink.value = true generatingLink.value = true
await authApi await authApi
.get(`/auth/profile/export/${filename}`, { .get(`/auth/account/export/${filename}`, {
responseType: 'blob', responseType: 'blob',
}) })
.then((response) => { .then((response) => {

View File

@ -452,7 +452,7 @@ export const actions: ActionTree<IAuthUserState, IRootState> &
): void { ): void {
context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES) context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)
authApi authApi
.post('auth/profile/export/request') .post('auth/account/export/request')
.then((res) => { .then((res) => {
if (res.data.status === 'success') { if (res.data.status === 'success') {
context.commit( context.commit(
@ -470,7 +470,7 @@ export const actions: ActionTree<IAuthUserState, IRootState> &
): void { ): void {
context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES) context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)
authApi authApi
.get('auth/profile/export') .get('auth/account/export')
.then((res) => { .then((res) => {
if (res.data.status === 'success') { if (res.data.status === 'success') {
context.commit( context.commit(