mirror of
https://github.com/zhigang1992/now-deployment.git
synced 2026-06-15 02:09:11 +08:00
21 lines
437 B
TypeScript
21 lines
437 B
TypeScript
import Client from '../client';
|
|
import { ProjectNotFound } from '../errors-ts';
|
|
|
|
export default async function removeProject(
|
|
client: Client,
|
|
projectNameOrId: string
|
|
) {
|
|
try {
|
|
await client.fetch<{}>(
|
|
`/projects/${encodeURIComponent(projectNameOrId)}`,
|
|
{ 'method': 'DELETE' }
|
|
);
|
|
} catch (error) {
|
|
if (error.status === 404) {
|
|
return new ProjectNotFound(projectNameOrId);
|
|
}
|
|
|
|
throw error;
|
|
}
|
|
}
|