Răsfoiți Sursa

有文集过滤器的时候新建文集自动加入文集

visuddhinanda 3 ani în urmă
părinte
comite
9329faa881

+ 4 - 1
dashboard/src/components/article/ArticleCreate.tsx

@@ -15,13 +15,15 @@ interface IFormData {
   title: string;
   lang: string;
   studio: string;
+  anthologyId?: string;
 }
 
 interface IWidget {
   studio?: string;
+  anthologyId?: string;
   onSuccess?: Function;
 }
-const Widget = ({ studio, onSuccess }: IWidget) => {
+const Widget = ({ studio, anthologyId, onSuccess }: IWidget) => {
   const intl = useIntl();
   const formRef = useRef<ProFormInstance>();
 
@@ -34,6 +36,7 @@ const Widget = ({ studio, onSuccess }: IWidget) => {
           return;
         }
         values.studio = studio;
+        values.anthologyId = anthologyId;
         const res = await post<IArticleCreateRequest, IArticleResponse>(
           `/v2/article`,
           values

+ 1 - 0
dashboard/src/pages/studio/article/list.tsx

@@ -415,6 +415,7 @@ const Widget = () => {
             content={
               <ArticleCreate
                 studio={studioname}
+                anthologyId={anthologyId}
                 onSuccess={() => {
                   setOpenCreate(false);
                   ref.current?.reload();