aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/Notes/Notes.module.scss2
-rw-r--r--apps/Notes/helpers/export.js2
-rw-r--r--apps/Notes/helpers/noteActions.js16
3 files changed, 9 insertions, 11 deletions
diff --git a/apps/Notes/Notes.module.scss b/apps/Notes/Notes.module.scss
index a87adac..a8ad168 100644
--- a/apps/Notes/Notes.module.scss
+++ b/apps/Notes/Notes.module.scss
@@ -111,6 +111,7 @@
}
p {
+ line-height: 1.33;
padding: 0 1rem 1rem;
white-space: pre-line;
user-select: text;
@@ -157,7 +158,6 @@
border: none;
padding: 0.5rem;
font-size: 1rem;
- // font-weight: 600;
border: 1px dashed var(--color-window-buttons);
&:placeholder {
diff --git a/apps/Notes/helpers/export.js b/apps/Notes/helpers/export.js
index 80fa100..4a0db9c 100644
--- a/apps/Notes/helpers/export.js
+++ b/apps/Notes/helpers/export.js
@@ -23,7 +23,7 @@ export const handleExport = (e, ids, notes) => {
Promise.all(ids.map(async id => {
const title = notes.find(n => n.noteId === id).title
- const {content} = await fetchJson(`/api/note/${id}`)
+ const {content} = await fetchJson(`/api/notes/${id}`)
zip.folder('notes').file(filename(title), content, {binary: true})
})).then(() => {
zip.generateAsync({type:"blob"})
diff --git a/apps/Notes/helpers/noteActions.js b/apps/Notes/helpers/noteActions.js
index f67e7a4..f864e58 100644
--- a/apps/Notes/helpers/noteActions.js
+++ b/apps/Notes/helpers/noteActions.js
@@ -4,7 +4,7 @@ import filename from '../helpers/fileName'
export const getNote = async (note, setFetchedNote, t, setPopup, callback) => {
try {
- const {content} = await fetchJson(`/api/note/${note.noteId}`)
+ const {content} = await fetchJson(`/api/notes/${note.noteId}`)
setFetchedNote({ ...note, content})
callback()
} catch (err) {
@@ -50,10 +50,10 @@ export const updateNote = async (e, note, mutateNotes, setAction, t, setPopup) =
try {
mutateNotes(
- await fetchJson('/api/notes', {
+ await fetchJson(`/api/notes/${_id}`, {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({_id, title, noteId, content}),
+ body: JSON.stringify({title, noteId, content}),
})
)
setPopup({
@@ -76,10 +76,8 @@ export const removeNote = (e, _id, mutateNotes, t, setPopup, setAction) => {
const remove = async () => {
try {
await mutateNotes(
- await fetchJson('/api/notes', {
+ await fetchJson(`/api/notes/${_id}`, {
method: 'DELETE',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({_id}),
})
)
setPopup({
@@ -98,8 +96,8 @@ export const removeNote = (e, _id, mutateNotes, t, setPopup, setAction) => {
setPopup({
content: t('notes_remove_confirm'),
- yes: { label: t('remove'), action: remove },
- no: { label: t('cancel'), action: async () => {} },
+ yes: {label: t('remove'), action: remove},
+ no: {label: t('cancel'), action: async () => {}},
error: true,
})
}
@@ -108,7 +106,7 @@ export const exportNote = async note => {
const {title} = note
const {content} = note.content
? note
- : await fetchJson(`/api/note/${note.noteId}`)
+ : await fetchJson(`/api/notes/${note.noteId}`)
saveFile(content, filename(title), 'text/plain')
}