1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-27 23:09:35 +02:00

Add custom icons to bookmarks (#5)

* allow custom icons for bookmarks

* update docker-image action to tag images based on source branch
This commit is contained in:
François Darveau 2021-06-27 15:17:23 -04:00 committed by François Darveau
parent 1b57668792
commit 0097ae2a77
2 changed files with 25 additions and 24 deletions

View file

@ -50,10 +50,10 @@ const Bookmarks = (props: ComponentProps): JSX.Element => {
updatedAt: new Date(),
});
const [bookmarkInUpdate, setBookmarkInUpdate] = useState<Bookmark>({
name: "",
url: "",
name: "string",
url: "string",
categoryId: -1,
icon: "",
icon: "string",
isPinned: false,
orderId: 0,
id: 0,

View file

@ -132,35 +132,36 @@ export const pinApp = (app: App) => async (dispatch: Dispatch) => {
/**
* ADD APP
*/
*/
export interface AddAppAction {
type: ActionTypes.addAppSuccess;
payload: App;
}
export const addApp = (formData: NewApp | FormData) => async (dispatch: Dispatch) => {
try {
const res = await axios.post<ApiResponse<App>>("/api/apps", formData);
export const addApp =
(formData: NewApp | FormData) => async (dispatch: Dispatch) => {
try {
const res = await axios.post<ApiResponse<App>>("/api/apps", formData);
dispatch<CreateNotificationAction>({
type: ActionTypes.createNotification,
payload: {
title: "Success",
message: `App ${res.data.data.name} added`,
},
});
dispatch<CreateNotificationAction>({
type: ActionTypes.createNotification,
payload: {
title: "Success",
message: `App ${res.data.data.name} added`,
},
});
await dispatch<AddAppAction>({
type: ActionTypes.addAppSuccess,
payload: res.data.data,
});
await dispatch<AddAppAction>({
type: ActionTypes.addAppSuccess,
payload: res.data.data,
});
// Sort apps
dispatch<any>(sortApps());
} catch (err) {
console.log(err);
}
};
// Sort apps
dispatch<any>(sortApps());
} catch (err) {
console.log(err);
}
};
/**
* PIN CATEGORY