misc: addressed comments

This commit is contained in:
Sheen Capadngan
2024-09-11 13:29:43 +08:00
parent aa42aa05aa
commit d23a7e41f3
24 changed files with 125 additions and 98 deletions
@@ -2,6 +2,7 @@ import { useEffect } from "react";
import { Controller, useForm } from "react-hook-form";
import { useRouter } from "next/router";
import { zodResolver } from "@hookform/resolvers/zod";
import slugify from "@sindresorhus/slugify";
import axios from "axios";
import { z } from "zod";
@@ -21,7 +22,13 @@ type Props = {
};
const slackFormSchema = z.object({
slug: z.string(),
slug: z
.string()
.trim()
.min(1)
.refine((v) => slugify(v) === v, {
message: "Alias must be a valid slug"
}),
description: z.string().optional()
});
@@ -42,7 +42,7 @@ const getCustomSlackAppCreationUrl = () =>
oauth_config: {
redirect_urls: [`${window.origin}/api/v1/workflow-integrations/slack/oauth_redirect`],
scopes: {
bot: ["chat:write.public", "chat:write"]
bot: ["chat:write.public", "chat:write", "channels:read", "groups:read"]
}
},
settings: {