Skip to content

Commit

Permalink
refac: Run prettier on src/api/http.ts
Browse files Browse the repository at this point in the history
Signed-off-by: Noble Mittal <[email protected]>
  • Loading branch information
beingnoble03 committed Aug 13, 2024
1 parent 9c67905 commit a1d57c0
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions web/vtadmin/src/api/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 <R extends pb.IVTExplainRequest>({ cluster, keyspace, sql }: R) => {
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit a1d57c0

Please sign in to comment.