mocker icon indicating copy to clipboard operation
mocker copied to clipboard

The resource link has problem

Open yangwawa0323 opened this issue 2 years ago • 2 comments

When login successfully into dashboard. All the resource link is point /api/user/:endpoint, this make people confused. It should be /api/resource/:endpoint. Another problem is couldn't use COPY button copy to clipboard.

in FE collection.jsx

<Alert sx={{ mb: 2 }}>
		<AlertTitle sx={{ fontWeight: 600 }}>API endpoint</AlertTitle>
		<code>{BACKEND_URL}/resource/:endpoint</code>
		<CopyButton
			sx={{ ml: 1 }}
			disabled={isCopied ? true : false}
			onClick={() => {
				handleCopyClick(`${BACKEND_URL}/resource/:endpoint`);
			}}
		>
			{isCopied ? 'Done' : 'Copy'}
		</CopyButton>
</Alert>

In FE EndpointModel.jsx

<CopyButton
		onClick={() =>
		handleCopyClick(
		`${BACKEND_URL}/resource/${result}${point.endpoint}`,
		idx
		)
		}
		disabled={isCopied === idx ? true : false}
>
	{isCopied === idx ? 'Done' : 'Copy'}
</CopyButton>

yangwawa0323 avatar Feb 03 '23 07:02 yangwawa0323