Skip to content

Commit b27a6cd

Browse files
committed
Added mode prop in FeedSourceCreate and FeedSourceEdit components
1 parent 645ceb8 commit b27a6cd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/components/feed-sources/feed-source-create.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import FeedSourceManager from "./feed-source-manager";
77
* @returns {object} The themes create page.
88
*/
99
function FeedSourceCreate() {
10+
11+
const mode = "create";
1012
// Initialize to empty feed source object.
1113
const data = {
1214
title: "",
@@ -21,7 +23,7 @@ function FeedSourceCreate() {
2123
resources: "",
2224
};
2325

24-
return <FeedSourceManager saveMethod="POST" initialState={data} />;
26+
return <FeedSourceManager saveMethod="POST" initialState={data} mode={mode} />;
2527
}
2628

2729
export default FeedSourceCreate;

src/components/feed-sources/feed-source-edit.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,22 @@ import FeedSourceManager from "./feed-source-manager";
1010
*/
1111
function FeedSourceEdit() {
1212
const { id } = useParams();
13-
13+
const mode = "edit";
1414
const {
1515
data,
1616
error: loadingError,
1717
isLoading,
1818
} = useGetV2FeedSourcesByIdQuery({ id });
1919

20+
console.log(data);
2021
return (
2122
<FeedSourceManager
2223
saveMethod="PUT"
2324
initialState={data}
2425
id={id}
2526
loadingError={loadingError}
2627
isLoading={isLoading}
28+
mode={mode}
2729
/>
2830
);
2931
}

0 commit comments

Comments
 (0)