Skip to content

Commit

Permalink
feat: add toast to create routes
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuagraber committed Nov 18, 2024
1 parent bf84472 commit 1f99387
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 0 additions & 3 deletions client/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ main {
.pdap-toast-container {
top: 120px;
}
.pdap-toast {
@apply max-w-lg;
}
:root {
--toastify-color-light: rgb(255 253 253);
Expand Down
6 changes: 5 additions & 1 deletion client/src/pages/data-source/create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
intent="primary"
type="submit"
>
Submit request
Submit data source
</Button>
<Button
:disabled="requestPending"
Expand All @@ -156,6 +156,7 @@
import { Button, FormV2, InputText, InputTextArea } from 'pdap-design-system';
import Typeahead from '@/components/TypeaheadInput.vue';
import AgencySelected from '@/components/TypeaheadSelected.vue';
import { toast } from 'vue3-toastify';
import { formatText } from './_util';
import _debounce from 'lodash/debounce';
import _cloneDeep from 'lodash/cloneDeep';
Expand Down Expand Up @@ -306,6 +307,9 @@ async function submit(values) {
try {
await createDataSource(requestBody);
const message = `${values[INPUT_NAMES.name]} has been submitted successfully!\nIt will be available in our data sources database after approval.`;
toast.success(message, { autoClose: false });
} catch (error) {
if (error) {
console.error(error);
Expand Down
3 changes: 3 additions & 0 deletions client/src/pages/request/create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ import {
} from 'pdap-design-system';
import Typeahead from '@/components/TypeaheadInput.vue';
import LocationSelected from '@/components/TypeaheadSelected.vue';
import { toast } from 'vue3-toastify';
import { useRequestStore } from '@/stores/request';
import { formatText } from './_util';
import _debounce from 'lodash/debounce';
Expand Down Expand Up @@ -356,6 +357,8 @@ async function submit(values) {
try {
await createRequest(requestBody);
const message = `Your request for ${values[INPUT_NAMES.title]} has been submitted successfully!`;
toast.success(message, { autoClose: false });
} catch (error) {
if (error) {
console.error(error);
Expand Down

0 comments on commit 1f99387

Please sign in to comment.