Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
})
getUser(
@pathParam({ description: "User unique identifier" }) userId: Int64
): Promise<{
name: string;
age?: Float;
}> {
return response();
}
@endpoint({
method: "DELETE",
path: "/users/:userId-confirmed",
tags: ["users"]
})
@genericError()
@specificError({
name: "forbidden",
statusCode: 403
})
deleteUser(
@pathParam() userId: Int64,
@header({
name: "Authorization"
})
authToken: string
): null {
return response();
}
}
// Requests and responses.
genericError,
header,
Int64,
pathParam,
response,
specificError
} from "@airtasker/spot";
import { BaseError, ForbiddenError } from "../errors";
export class DeleteUser {
@endpoint({
method: "DELETE",
path: "/users/:userId-confirmed",
tags: ["users"]
})
@genericError()
@specificError({
name: "forbidden",
statusCode: 403
})
deleteUser(
@pathParam() userId: Int64,
@header({
name: "Authorization"
})
authToken: string
): null {
return response();
}
}