Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import { ref } from "@nuxtjs/composition-api";
import { useResolve } from "ts-injecty";
import { Question } from "~/v1/domain/entities/question/Question";
import { UpdateQuestionSettingUseCase } from "~/v1/domain/usecases/dataset-setting/update-question-setting-use-case";
import { useNotifications } from "~/v1/infrastructure/services/useNotifications";

export const useSettingsQuestionsViewModel = () => {
const updateQuestionSettingsUseCase = useResolve(UpdateQuestionSettingUseCase);
const notification = useNotifications();
const newLabelText = ref({});

const restore = (question: Question) => {
Expand All @@ -29,7 +31,10 @@ export const useSettingsQuestionsViewModel = () => {
);

if (existingOption) {
// TODO: Show error message that option already exists
notification.notify({
message: "Label already exists. Please choose a different one.",
type: "warning",
});
return;
}

Expand Down