Skip to content

Commit

Permalink
redirect to newly created lyrics
Browse files Browse the repository at this point in the history
  • Loading branch information
kkuepper committed Dec 2, 2024
1 parent dd5fd6e commit ecbff6c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"dependencies": {
"@auth0/auth0-vue": "^2.3.3",
"@bcc-code/bmm-sdk-fetch": "^8.7.2",
"@bcc-code/bmm-sdk-fetch": "^8.7.3",
"@floating-ui/vue": "^1.0.6",
"@headlessui/vue": "^1.7.19",
"@microsoft/applicationinsights-web": "^3.0.8",
Expand Down
4 changes: 3 additions & 1 deletion pages/lyrics/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useRouteQuery } from "@vueuse/router";
import type { Lyrics } from "@bcc-code/bmm-sdk-fetch";
import { DEFAULT_LONG_COPYRIGHT } from "./[id].vue";
const router = useRouter();
const { t } = useI18n();
setTitle(() => t("nav.lyrics"));
Expand All @@ -26,14 +27,15 @@ async function createLyrics() {
loading.value = true;
try {
await new LyricsApi().lyricsPost({
const newId = await new LyricsApi().lyricsPost({
lyrics: {
songTitle: createForm.title,
source: "Manual",
longCopyright: DEFAULT_LONG_COPYRIGHT,
},
});
resetForm();
router.push({ name: "lyrics-id", params: { id: newId } });
} catch (err) {
showErrorToUser("CreateLyricsFailed", "Failed to create lyrics");
} finally {
Expand Down
24 changes: 12 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ecbff6c

Please sign in to comment.