Fixed destructure error.
This commit is contained in:
@@ -116,7 +116,7 @@ export default async (req: NextApiRequestCollect, res: NextApiResponse) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function validateBody(res: NextApiResponse, { type, payload }: CollectRequestBody) {
|
function validateBody(res: NextApiResponse, { type, payload }: CollectRequestBody) {
|
||||||
const { data } = payload;
|
const { data } = payload || {};
|
||||||
|
|
||||||
// Validate type
|
// Validate type
|
||||||
if (type !== COLLECTION_TYPE.event && type !== COLLECTION_TYPE.identify) {
|
if (type !== COLLECTION_TYPE.event && type !== COLLECTION_TYPE.identify) {
|
||||||
|
|||||||
Reference in New Issue
Block a user