Skip to content

Commit

Permalink
fix: note (#30)
Browse files Browse the repository at this point in the history
* fix: note

* feat: some clean

* fix: tu
  • Loading branch information
pichoemr authored Jun 15, 2023
1 parent 05fc082 commit 5a91e26
Show file tree
Hide file tree
Showing 4 changed files with 374 additions and 57 deletions.
1 change: 0 additions & 1 deletion src/listeners/note.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export async function saveNote(props, event, api) {
props.note = event.value.note;
return api.data.updateDoc(props);
}

return api.data.createDoc(new Note(props.session, "@me", event.value.note));
}

Expand Down
2 changes: 1 addition & 1 deletion src/views/pages/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function ([favorite], /* _props, */{ context: { pathParams } })
).onPressed("@lenra:navTo", { path: openfeedbacks[session.attributes.key] }),
])
.spacing(16),
View(views.personnalNotes).data(DataApi.collectionName(Note), {user: "@me", session: session.attributes.key}),
View(views.personnalNotes).data(DataApi.collectionName(Note), { user: "@me", session: session.attributes.key }).props({ session: session.attributes.key }),
])
.direction("vertical")
.spacing(16)
Expand Down
4 changes: 2 additions & 2 deletions src/views/personnalNotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Note } from '../classes/Note.js';
* @param {*} _props
* @returns
*/
export default function (notes, _props) {
export default function (notes, props) {
const boxShadow = Container.card().toJSON().decoration.boxShadow;
return Flex([
Text('Notes personnelles').style({
Expand All @@ -34,7 +34,7 @@ export default function (notes, _props) {
])
.spacing(16)
.crossAxisAlignment('center'),
).onSubmit('saveNote'),
).onSubmit('saveNote', props),
Flex(
notes
.sort((a, b) => b.creationDate - a.creationDate)
Expand Down
Loading

0 comments on commit 5a91e26

Please sign in to comment.