diff --git a/javascripts/ajouter-un-album.js b/javascripts/ajouter-un-album.js
index ef5cd90..02f50d4 100644
--- a/javascripts/ajouter-un-album.js
+++ b/javascripts/ajouter-un-album.js
@@ -1,6 +1,8 @@
Vue.createApp({
data() {
return {
+ // eslint-disable-next-line no-undef
+ share: canPublish,
q: "",
year: "",
country: "",
@@ -169,7 +171,10 @@ Vue.createApp({
this.submitting = true;
return axios
- .post("/api/v1/albums", this.details)
+ .post("/api/v1/albums", {
+ album: this.details,
+ share: this.share,
+ })
.then(() => {
window.location.href = "/ma-collection";
})
diff --git a/sass/modal.scss b/sass/modal.scss
index e44de67..e76be5e 100644
--- a/sass/modal.scss
+++ b/sass/modal.scss
@@ -116,6 +116,17 @@
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
border-top: 1px solid var(--border-color);
+ justify-content: end;
+ align-items: baseline;
+
+ .field {
+ flex-direction: row;
+
+ padding: 6px;
+ span {
+ padding-left: 6px;
+ }
+ }
.button:not(:last-child) {
margin-right: .5em;
diff --git a/src/middleware/Albums.js b/src/middleware/Albums.js
index 97058bc..c5ba642 100644
--- a/src/middleware/Albums.js
+++ b/src/middleware/Albums.js
@@ -25,8 +25,9 @@ class Albums extends Pages {
*/
static async postAddOne(req) {
const { body, user } = req;
+ const { album: albumDetails, share } = body;
const data = {
- ...body,
+ ...albumDetails,
discogsId: body.id,
User: user._id,
};
@@ -54,7 +55,7 @@ class Albums extends Pages {
const { publish, token, url, message } = mastodonConfig;
- if (publish && url && token) {
+ if (share && publish && url && token) {
const M = new Mastodon({
access_token: token,
api_url: url,
diff --git a/views/pages/ajouter-un-album.ejs b/views/pages/ajouter-un-album.ejs
index d48aa4c..2574670 100644
--- a/views/pages/ajouter-un-album.ejs
+++ b/views/pages/ajouter-un-album.ejs
@@ -181,9 +181,21 @@
-
\ No newline at end of file
+
+
+
\ No newline at end of file