From a1d57c061af4a32c412271d8b133563ab6d1e53b Mon Sep 17 00:00:00 2001 From: Noble Mittal Date: Tue, 13 Aug 2024 00:45:44 +0530 Subject: [PATCH] refac: Run prettier on src/api/http.ts Signed-off-by: Noble Mittal --- web/vtadmin/src/api/http.ts | 39 ++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/web/vtadmin/src/api/http.ts b/web/vtadmin/src/api/http.ts index 0a99c224c35..4cf551236db 100644 --- a/web/vtadmin/src/api/http.ts +++ b/web/vtadmin/src/api/http.ts @@ -265,7 +265,9 @@ export const deleteTablet = async ({ allowPrimary, clusterID, alias }: DeleteTab req.append('allow_primary', allowPrimary.toString()); } - const { result } = await vtfetch(`/api/tablet/${alias}?${req}`, { method: 'delete' }); + const { result } = await vtfetch(`/api/tablet/${alias}?${req}`, { + method: 'delete', + }); const err = pb.DeleteTabletResponse.verify(result); if (err) throw Error(err); @@ -437,19 +439,13 @@ export const fetchWorkflow = async (params: { clusterID: string; keyspace: strin return pb.Workflow.create(result); }; -export const fetchWorkflowStatus = async (params: { - clusterID: string; - keyspace: string; - name: string; -}) => { - const { result } = await vtfetch( - `/api/workflow_status/${params.clusterID}/${params.keyspace}/${params.name}` - ); +export const fetchWorkflowStatus = async (params: { clusterID: string; keyspace: string; name: string }) => { + const { result } = await vtfetch(`/api/workflow_status/${params.clusterID}/${params.keyspace}/${params.name}`); - const err = vtctldata.WorkflowStatusResponse.verify(result); - if (err) throw Error(err); + const err = vtctldata.WorkflowStatusResponse.verify(result); + if (err) throw Error(err); - return vtctldata.WorkflowStatusResponse.create(result); + return vtctldata.WorkflowStatusResponse.create(result); }; export const fetchVTExplain = async ({ cluster, keyspace, sql }: R) => { @@ -568,7 +564,9 @@ export const reloadSchema = async (params: ReloadSchemaParams) => { req.append('wait_position', params.waitPosition); } - const { result } = await vtfetch(`/api/schemas/reload?${req}`, { method: 'put' }); + const { result } = await vtfetch(`/api/schemas/reload?${req}`, { + method: 'put', + }); const err = pb.ReloadSchemasResponse.verify(result); if (err) throw Error(err); @@ -589,7 +587,9 @@ export const deleteShard = async (params: DeleteShardParams) => { req.append('even_if_serving', String(params.evenIfServing)); req.append('recursive', String(params.recursive)); - const { result } = await vtfetch(`/api/shards/${params.clusterID}?${req}`, { method: 'delete' }); + const { result } = await vtfetch(`/api/shards/${params.clusterID}?${req}`, { + method: 'delete', + }); const err = vtctldata.DeleteShardsResponse.verify(result); if (err) throw Error(err); @@ -716,7 +716,10 @@ export interface RebuildKeyspaceGraphParams { export const rebuildKeyspaceGraph = async (params: RebuildKeyspaceGraphParams) => { const { result } = await vtfetch(`/api/keyspace/${params.clusterID}/${params.keyspace}/rebuild_keyspace_graph`, { method: 'put', - body: JSON.stringify({ cells: params.cells, allow_partial: params.allowPartial }), + body: JSON.stringify({ + cells: params.cells, + allow_partial: params.allowPartial, + }), }); const err = pb.RebuildKeyspaceGraphRequest.verify(result); if (err) throw Error(err); @@ -735,7 +738,11 @@ export interface RemoveKeyspaceCellParams { export const removeKeyspaceCell = async (params: RemoveKeyspaceCellParams) => { const { result } = await vtfetch(`/api/keyspace/${params.clusterID}/${params.keyspace}/remove_keyspace_cell`, { method: 'put', - body: JSON.stringify({ cell: params.cell, force: params.force, recursive: params.recursive }), + body: JSON.stringify({ + cell: params.cell, + force: params.force, + recursive: params.recursive, + }), }); const err = pb.RemoveKeyspaceCellRequest.verify(result); if (err) throw Error(err);