5 Commits

  1. 17
      CHANGELOG.md
  2. 158
      assets/package-lock.json
  3. 6
      assets/package.json
  4. 6
      lib/mirage/images/uploader.ex
  5. 22
      lib/mirage_web/controllers/api/v1/daily_controller.ex
  6. 13
      lib/mirage_web/controllers/api/v1/note_controller.ex
  7. 5
      lib/mirage_web/router.ex
  8. 2
      mix.exs

17
CHANGELOG.md

@ -5,6 +5,23 @@ See [Conventional Commits](Https://conventionalcommits.org) for commit guideline
<!-- changelog -->
## [v0.102.0](https://git.inhji.de/inhji/mirage/compare/v0.101.0...v0.102.0) (2021-04-04)
### Chores:
* update npm deps
* update npm deps
### Features:
* add strip image version
* add initial version of api
## [v0.101.0](https://git.inhji.de/inhji/mirage/compare/v0.100.0...v0.101.0) (2021-03-31)

158
assets/package-lock.json

@ -5,8 +5,8 @@
"packages": {
"": {
"dependencies": {
"@yaireo/tagify": "^3.22.3",
"bootstrap-icons": "^1.4.0",
"@yaireo/tagify": "^4.X",
"bootstrap-icons": "^1.4.1",
"easymde": "^2.14.0",
"normalize.css": "^8.0.1",
"nprogress": "^0.2.0",
@ -30,7 +30,7 @@
"postcss-nested": "^5.X",
"postcss-preset-env": "^6.7.0",
"terser-webpack-plugin": "^5.1.1",
"webpack": "^5.21.2",
"webpack": "^5.30",
"webpack-bundle-analyzer": "^4.4.0",
"webpack-cli": "^4.x"
},
@ -1342,9 +1342,9 @@
"dev": true
},
"node_modules/@types/eslint": {
"version": "7.2.7",
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.7.tgz",
"integrity": "sha512-EHXbc1z2GoQRqHaAT7+grxlTJ3WE2YNeD6jlpPoRc83cCoThRY+NUWjCUZaYmk51OICkPXn2hhphcWcWXgNW0Q==",
"version": "7.2.8",
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.8.tgz",
"integrity": "sha512-RTKvBsfz0T8CKOGZMfuluDNyMFHnu5lvNr4hWEsQeHXH6FcmIDIozOyWMh36nLGMwVd5UFNXC2xztA8lln22MQ==",
"dev": true,
"dependencies": {
"@types/estree": "*",
@ -1586,9 +1586,9 @@
"dev": true
},
"node_modules/@yaireo/tagify": {
"version": "3.25.0",
"resolved": "https://registry.npmjs.org/@yaireo/tagify/-/tagify-3.25.0.tgz",
"integrity": "sha512-aBRkGDkWdv6ZnRUCcA0mBIK5f3YegnxlFO9vj9zN5zSAUO90m2v5TsOPYN60sk6RNU/y556oc8jAmeSY7FUvaQ==",
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/@yaireo/tagify/-/tagify-4.0.1.tgz",
"integrity": "sha512-b9TxIlaZwNy8ESZx/NR5zNGgQk5MIduWtcOoTbst0ca2BGll+Kj/dQOfGs4NmqSIU+XBIGcGPrAKVKITlOJIMA==",
"peerDependencies": {
"prop-types": "^15.7.2"
}
@ -1856,9 +1856,9 @@
"dev": true
},
"node_modules/bootstrap-icons": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.4.0.tgz",
"integrity": "sha512-EynaOv/G/X/sQgPUqkdLJoxPrWk73wwsVjVR3cDNYO0jMS58poq7DOC2CraBWlBt1AberEmt0blfw4ony2/ZIg==",
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.4.1.tgz",
"integrity": "sha512-EcATaAGsRgyy4NtnwXlNzkgWttpb6PqcXCoLtZZKdZtAYJU/WYqoQFxuGFKAppOlf7NmKpvGtSsC/921H7LIjg==",
"engines": {
"node": ">=10"
}
@ -2013,9 +2013,9 @@
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001204",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001204.tgz",
"integrity": "sha512-JUdjWpcxfJ9IPamy2f5JaRDCaqJOxDzOSKtbdx4rH9VivMd1vIzoPumsJa9LoMIi4Fx2BV2KZOxWhNkBjaYivQ==",
"version": "1.0.30001205",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001205.tgz",
"integrity": "sha512-TL1GrS5V6LElbitPazidkBMD9sa448bQDDLrumDqaggmKFcuU2JW1wTOHJPukAcOMtEmLcmDJEzfRrf+GjM0Og==",
"dev": true
},
"node_modules/chalk": {
@ -2225,9 +2225,9 @@
}
},
"node_modules/core-js-compat": {
"version": "3.9.1",
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.9.1.tgz",
"integrity": "sha512-jXAirMQxrkbiiLsCx9bQPJFA6llDadKMpYrBJQJ3/c4/vsPP/fAf29h24tviRlvwUL6AmY5CHLu2GvjuYviQqA==",
"version": "3.10.0",
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.10.0.tgz",
"integrity": "sha512-9yVewub2MXNYyGvuLnMHcN1k9RkvB7/ofktpeKTIaASyB88YYqGzUnu0ywMMhJrDHOMiTjSHWGzR+i7Wb9Z1kQ==",
"dev": true,
"dependencies": {
"browserslist": "^4.16.3",
@ -2952,9 +2952,9 @@
}
},
"node_modules/csso/node_modules/css-tree": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.2.tgz",
"integrity": "sha512-wCoWush5Aeo48GLhfHPbmvZs59Z+M7k5+B1xDnXbdWNcEF423DoFdqSWE0PM5aNk5nI5cp1q7ms36zGApY/sKQ==",
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz",
"integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==",
"dev": true,
"dependencies": {
"mdn-data": "2.0.14",
@ -3037,9 +3037,9 @@
}
},
"node_modules/dom-serializer/node_modules/domelementtype": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.1.0.tgz",
"integrity": "sha512-LsTgx/L5VpD+Q8lmsXSHW2WpA+eBlZ9HPf3erD1IoPF00/3JKHZ3BknUVA2QGDNu69ZNmyFmCWBSO45XjYKC5w==",
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz",
"integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==",
"dev": true,
"funding": [
{
@ -3093,9 +3093,9 @@
}
},
"node_modules/electron-to-chromium": {
"version": "1.3.701",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.701.tgz",
"integrity": "sha512-Zd9ofdIMYHYhG1gvnejQDvC/kqSeXQvtXF0yRURGxgwGqDZm9F9Fm3dYFnm5gyuA7xpXfBlzVLN1sz0FjxpKfw==",
"version": "1.3.707",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.707.tgz",
"integrity": "sha512-BqddgxNPrcWnbDdJw7SzXVzPmp+oiyjVrc7tkQVaznPGSS9SKZatw6qxoP857M+HbOyyqJQwYQtsuFIMSTNSZA==",
"dev": true
},
"node_modules/emojis-list": {
@ -4383,21 +4383,21 @@
}
},
"node_modules/mime-db": {
"version": "1.46.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.46.0.tgz",
"integrity": "sha512-svXaP8UQRZ5K7or+ZmfNhg2xX3yKDMUzqadsSqi4NCH/KomcH75MAMYAGVlvXn4+b/xOPhS3I2uHKRUzvjY7BQ==",
"version": "1.47.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz",
"integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==",
"dev": true,
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime-types": {
"version": "2.1.29",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.29.tgz",
"integrity": "sha512-Y/jMt/S5sR9OaqteJtslsFZKWOIIqMACsJSiHghlCAyhf7jfVYjKBmLiX8OgpWeW+fjJ2b+Az69aPFPkUOY6xQ==",
"version": "2.1.30",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz",
"integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==",
"dev": true,
"dependencies": {
"mime-db": "1.46.0"
"mime-db": "1.47.0"
},
"engines": {
"node": ">= 0.6"
@ -4941,12 +4941,12 @@
}
},
"node_modules/postcss": {
"version": "8.2.8",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.2.8.tgz",
"integrity": "sha512-1F0Xb2T21xET7oQV9eKuctbM9S7BC0fetoHCc4H13z0PT6haiRLP4T0ZY4XWh7iLP0usgqykT6p9B2RtOf4FPw==",
"version": "8.2.9",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.2.9.tgz",
"integrity": "sha512-b+TmuIL4jGtCHtoLi+G/PisuIl9avxs8IZMSmlABRwNz5RLUUACrC+ws81dcomz1nRezm5YPdXiMEzBEKgYn+Q==",
"dependencies": {
"colorette": "^1.2.2",
"nanoid": "^3.1.20",
"nanoid": "^3.1.22",
"source-map": "^0.6.1"
},
"engines": {
@ -9305,9 +9305,9 @@
}
},
"node_modules/webpack": {
"version": "5.28.0",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.28.0.tgz",
"integrity": "sha512-1xllYVmA4dIvRjHzwELgW4KjIU1fW4PEuEnjsylz7k7H5HgPOctIq7W1jrt3sKH9yG5d72//XWzsHhfoWvsQVg==",
"version": "5.30.0",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.30.0.tgz",
"integrity": "sha512-Zr9NIri5yzpfmaMea2lSMV1UygbW0zQsSlGLMgKUm63ACXg6alhd1u4v5UBSBjzYKXJN6BNMGVM7w165e7NxYA==",
"dev": true,
"dependencies": {
"@types/eslint-scope": "^3.7.0",
@ -10738,9 +10738,9 @@
"dev": true
},
"@types/eslint": {
"version": "7.2.7",
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.7.tgz",
"integrity": "sha512-EHXbc1z2GoQRqHaAT7+grxlTJ3WE2YNeD6jlpPoRc83cCoThRY+NUWjCUZaYmk51OICkPXn2hhphcWcWXgNW0Q==",
"version": "7.2.8",
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.8.tgz",
"integrity": "sha512-RTKvBsfz0T8CKOGZMfuluDNyMFHnu5lvNr4hWEsQeHXH6FcmIDIozOyWMh36nLGMwVd5UFNXC2xztA8lln22MQ==",
"dev": true,
"requires": {
"@types/estree": "*",
@ -10969,9 +10969,9 @@
"dev": true
},
"@yaireo/tagify": {
"version": "3.25.0",
"resolved": "https://registry.npmjs.org/@yaireo/tagify/-/tagify-3.25.0.tgz",
"integrity": "sha512-aBRkGDkWdv6ZnRUCcA0mBIK5f3YegnxlFO9vj9zN5zSAUO90m2v5TsOPYN60sk6RNU/y556oc8jAmeSY7FUvaQ==",
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/@yaireo/tagify/-/tagify-4.0.1.tgz",
"integrity": "sha512-b9TxIlaZwNy8ESZx/NR5zNGgQk5MIduWtcOoTbst0ca2BGll+Kj/dQOfGs4NmqSIU+XBIGcGPrAKVKITlOJIMA==",
"requires": {}
},
"acorn": {
@ -11171,9 +11171,9 @@
"dev": true
},
"bootstrap-icons": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.4.0.tgz",
"integrity": "sha512-EynaOv/G/X/sQgPUqkdLJoxPrWk73wwsVjVR3cDNYO0jMS58poq7DOC2CraBWlBt1AberEmt0blfw4ony2/ZIg=="
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.4.1.tgz",
"integrity": "sha512-EcATaAGsRgyy4NtnwXlNzkgWttpb6PqcXCoLtZZKdZtAYJU/WYqoQFxuGFKAppOlf7NmKpvGtSsC/921H7LIjg=="
},
"brace-expansion": {
"version": "1.1.11",
@ -11291,9 +11291,9 @@
}
},
"caniuse-lite": {
"version": "1.0.30001204",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001204.tgz",
"integrity": "sha512-JUdjWpcxfJ9IPamy2f5JaRDCaqJOxDzOSKtbdx4rH9VivMd1vIzoPumsJa9LoMIi4Fx2BV2KZOxWhNkBjaYivQ==",
"version": "1.0.30001205",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001205.tgz",
"integrity": "sha512-TL1GrS5V6LElbitPazidkBMD9sa448bQDDLrumDqaggmKFcuU2JW1wTOHJPukAcOMtEmLcmDJEzfRrf+GjM0Og==",
"dev": true
},
"chalk": {
@ -11470,9 +11470,9 @@
}
},
"core-js-compat": {
"version": "3.9.1",
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.9.1.tgz",
"integrity": "sha512-jXAirMQxrkbiiLsCx9bQPJFA6llDadKMpYrBJQJ3/c4/vsPP/fAf29h24tviRlvwUL6AmY5CHLu2GvjuYviQqA==",
"version": "3.10.0",
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.10.0.tgz",
"integrity": "sha512-9yVewub2MXNYyGvuLnMHcN1k9RkvB7/ofktpeKTIaASyB88YYqGzUnu0ywMMhJrDHOMiTjSHWGzR+i7Wb9Z1kQ==",
"dev": true,
"requires": {
"browserslist": "^4.16.3",
@ -11997,9 +11997,9 @@
},
"dependencies": {
"css-tree": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.2.tgz",
"integrity": "sha512-wCoWush5Aeo48GLhfHPbmvZs59Z+M7k5+B1xDnXbdWNcEF423DoFdqSWE0PM5aNk5nI5cp1q7ms36zGApY/sKQ==",
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz",
"integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==",
"dev": true,
"requires": {
"mdn-data": "2.0.14",
@ -12064,9 +12064,9 @@
},
"dependencies": {
"domelementtype": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.1.0.tgz",
"integrity": "sha512-LsTgx/L5VpD+Q8lmsXSHW2WpA+eBlZ9HPf3erD1IoPF00/3JKHZ3BknUVA2QGDNu69ZNmyFmCWBSO45XjYKC5w==",
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz",
"integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==",
"dev": true
}
}
@ -12113,9 +12113,9 @@
}
},
"electron-to-chromium": {
"version": "1.3.701",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.701.tgz",
"integrity": "sha512-Zd9ofdIMYHYhG1gvnejQDvC/kqSeXQvtXF0yRURGxgwGqDZm9F9Fm3dYFnm5gyuA7xpXfBlzVLN1sz0FjxpKfw==",
"version": "1.3.707",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.707.tgz",
"integrity": "sha512-BqddgxNPrcWnbDdJw7SzXVzPmp+oiyjVrc7tkQVaznPGSS9SKZatw6qxoP857M+HbOyyqJQwYQtsuFIMSTNSZA==",
"dev": true
},
"emojis-list": {
@ -13070,18 +13070,18 @@
"dev": true
},
"mime-db": {
"version": "1.46.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.46.0.tgz",
"integrity": "sha512-svXaP8UQRZ5K7or+ZmfNhg2xX3yKDMUzqadsSqi4NCH/KomcH75MAMYAGVlvXn4+b/xOPhS3I2uHKRUzvjY7BQ==",
"version": "1.47.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz",
"integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==",
"dev": true
},
"mime-types": {
"version": "2.1.29",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.29.tgz",
"integrity": "sha512-Y/jMt/S5sR9OaqteJtslsFZKWOIIqMACsJSiHghlCAyhf7jfVYjKBmLiX8OgpWeW+fjJ2b+Az69aPFPkUOY6xQ==",
"version": "2.1.30",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz",
"integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==",
"dev": true,
"requires": {
"mime-db": "1.46.0"
"mime-db": "1.47.0"
}
},
"mimic-fn": {
@ -13470,12 +13470,12 @@
}
},
"postcss": {
"version": "8.2.8",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.2.8.tgz",
"integrity": "sha512-1F0Xb2T21xET7oQV9eKuctbM9S7BC0fetoHCc4H13z0PT6haiRLP4T0ZY4XWh7iLP0usgqykT6p9B2RtOf4FPw==",
"version": "8.2.9",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.2.9.tgz",
"integrity": "sha512-b+TmuIL4jGtCHtoLi+G/PisuIl9avxs8IZMSmlABRwNz5RLUUACrC+ws81dcomz1nRezm5YPdXiMEzBEKgYn+Q==",
"requires": {
"colorette": "^1.2.2",
"nanoid": "^3.1.20",
"nanoid": "^3.1.22",
"source-map": "^0.6.1"
},
"dependencies": {
@ -16748,9 +16748,9 @@
}
},
"webpack": {
"version": "5.28.0",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.28.0.tgz",
"integrity": "sha512-1xllYVmA4dIvRjHzwELgW4KjIU1fW4PEuEnjsylz7k7H5HgPOctIq7W1jrt3sKH9yG5d72//XWzsHhfoWvsQVg==",
"version": "5.30.0",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.30.0.tgz",
"integrity": "sha512-Zr9NIri5yzpfmaMea2lSMV1UygbW0zQsSlGLMgKUm63ACXg6alhd1u4v5UBSBjzYKXJN6BNMGVM7w165e7NxYA==",
"dev": true,
"requires": {
"@types/eslint-scope": "^3.7.0",

6
assets/package.json

@ -5,8 +5,8 @@
"watch": "webpack --mode development --watch"
},
"dependencies": {
"@yaireo/tagify": "^3.22.3",
"bootstrap-icons": "^1.4.0",
"@yaireo/tagify": "^4.X",
"bootstrap-icons": "^1.4.1",
"easymde": "^2.14.0",
"normalize.css": "^8.0.1",
"nprogress": "^0.2.0",
@ -30,7 +30,7 @@
"postcss-nested": "^5.X",
"postcss-preset-env": "^6.7.0",
"terser-webpack-plugin": "^5.1.1",
"webpack": "^5.21.2",
"webpack": "^5.30",
"webpack-bundle-analyzer": "^4.4.0",
"webpack-cli": "^4.x"
},

6
lib/mirage/images/uploader.ex

@ -2,7 +2,7 @@ defmodule Mirage.Images.ImageUploader do
use Waffle.Definition
use Waffle.Ecto.Definition
@versions [:original, :thumb, :wide, :mini]
@versions [:original, :thumb, :wide, :strip, :mini]
# Whitelist file extensions:
def validate({file, _}) do
@ -13,6 +13,10 @@ defmodule Mirage.Images.ImageUploader do
{:convert, "-strip -thumbnail 800x450^ -format png", :png}
end
def transform(:strip, _) do
{:convert, "-strip -thumbnail 800x150^ -gravity center -extent 800x150 -format png", :png}
end
def transform(:thumb, _) do
{:convert, "-strip -thumbnail 50x50^ -gravity center -extent 50x50 -format png", :png}
end

22
lib/mirage_web/controllers/api/v1/daily_controller.ex

@ -0,0 +1,22 @@
defmodule MirageWeb.API.V1.Notes.DailyController do
use MirageWeb, :controller
alias Mirage.Notes
def show(conn, _params) do
daily_note = Notes.list_notes(:today) |> List.first()
json(conn, %{
data: %{note: daily_note}
})
end
def update(conn, note_params) do
daily_note = Notes.list_notes(:today) |> List.first()
{:ok, note} = Notes.update_note(daily_note, note_params)
json(conn, %{
data: nil
})
end
end

13
lib/mirage_web/controllers/api/v1/note_controller.ex

@ -1,13 +0,0 @@
defmodule MirageWeb.API.V1.NoteController do
use MirageWeb, :controller
alias Mirage.Notes
def get_daily(conn, _params) do
daily_note = Notes.list_notes(:today) |> List.first()
json(conn, %{
data: %{note: daily_note}
})
end
end

5
lib/mirage_web/router.ex

@ -142,7 +142,10 @@ defmodule MirageWeb.Router do
pipe_through [:api_dev]
scope "/v1", V1, as: :v1 do
get "/notes/daily", NoteController, :get_daily
scope "/notes", Notes, as: :notes do
get "/daily", DailyController, :show
post "/daily", DailyController, :update
end
end
end
end

2
mix.exs

@ -1,7 +1,7 @@
defmodule Mirage.MixProject do
use Mix.Project
@version "0.101.0"
@version "0.102.0"
def project do
[

Loading…
Cancel
Save