renames team -> teams adds tests for users and teams
This commit is contained in:
1 parent
557342104b
commit
62a917c7a8
12 files changed
+355
-5
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import prisma from "@calcom/prisma";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
|
||||
import { schemaQueryId, withValidQueryIdString } from "@lib/validations/queryIdString";
|
||||
import { schemaQueryIdAsString, withValidQueryIdString } from "@lib/validations/queryIdString";
|
||||
|
||||
type ResponseData = {
|
||||
message?: string;
|
||||
@@ -10,7 +10,7 @@ type ResponseData = {
|
||||
|
||||
export async function apiKey(req: NextApiRequest, res: NextApiResponse<ResponseData>) {
|
||||
const { query, method } = req;
|
||||
const safe = await schemaQueryId.safeParse(query);
|
||||
const safe = await schemaQueryIdAsString.safeParse(query);
|
||||
if (safe.success) {
|
||||
if (method === "DELETE") {
|
||||
// DELETE WILL DELETE THE EVENT TYPE
|
||||
|
||||
File renamed without changes.
@@ -30,7 +30,7 @@ export async function editTeam(req: NextApiRequest, res: NextApiResponse<Respons
|
||||
}
|
||||
} else {
|
||||
// Reject any other HTTP method than POST
|
||||
res.status(405).json({ message: "Only PATCH Method allowed for updating team-types" });
|
||||
res.status(405).json({ message: "Only PATCH Method allowed for updating teams" });
|
||||
}
|
||||
}
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -30,7 +30,7 @@ export async function editUser(req: NextApiRequest, res: NextApiResponse<Respons
|
||||
}
|
||||
} else {
|
||||
// Reject any other HTTP method than POST
|
||||
res.status(405).json({ message: "Only PATCH Method allowed for updating user-types" });
|
||||
res.status(405).json({ message: "Only PATCH Method allowed for updating users" });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user