Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
[#513](https://github.com/nextcloud/cookbook/pull/513) @christianlupus
- Central parsing of parameters for POST/PUT requests to simplify development
[#518](https://github.com/nextcloud/cookbook/pull/518) @christianlupus
- Removed dependencies on the global jQuery
[#497](https://github.com/nextcloud/cookbook/pull/497/) @seyfeb

### Fixed
- Fixed keywords of shared recipes counted multiple times, fixes #491
Expand All @@ -26,7 +28,6 @@
- Update README with more clients
[#457](https://github.com/nextcloud/cookbook/pull/457) @geeseven


## 0.7.8 - 2021-01-08

### Added
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
},
"homepage": "https://github.com/mrzapp/nextcloud-cookbook#readme",
"dependencies": {
"@nextcloud/event-bus": "^1.1.4",
"@nextcloud/auth": "^1.3.0",
"@nextcloud/axios": "^1.6.0",
"@nextcloud/event-bus": "^1.2.0",
"@nextcloud/moment": "^1.1.1",
"@nextcloud/vue": "^1.5.0",
"lozad": "^1.16.0",
Expand Down
29 changes: 14 additions & 15 deletions src/components/AppControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
<script>
import ActionButton from '@nextcloud/vue/dist/Components/ActionButton'
import ActionInput from '@nextcloud/vue/dist/Components/ActionInput'
import axios from '@nextcloud/axios'
import Breadcrumbs from '@nextcloud/vue/dist/Components/Breadcrumbs'
import Breadcrumb from '@nextcloud/vue/dist/Components/Breadcrumb'

Expand Down Expand Up @@ -194,20 +195,18 @@ export default {
}
let id = this.$store.state.recipe.id
let $this = this
$.ajax({
url: window.baseUrl + '/api/recipes/' + id,
method: 'DELETE',
})
.done(function(reply) {
$this.$window.goTo('/')
$this.$root.$emit('refreshNavigation')
})
.fail(function(e) {
alert(t('cookbook', 'Delete failed'))
if (e && e instanceof Error) {
throw e
}
})

axios.delete(window.baseUrl + '/api/recipes/' + id)
.then(function(response) {
$this.$window.goTo('/')
$this.$root.$emit('refreshNavigation')
})
.catch(function(e) {
alert(t('cookbook', 'Delete failed'))
if (e && e instanceof Error) {
throw e
}
})
},
printRecipe: function() {
window.print()
Expand All @@ -225,7 +224,7 @@ export default {
this.$window.goTo('/search/'+e.target[1].value)
},
toggleNavigation: function() {
$("#app-navigation").toggleClass("show-navigation")
document.getElementById("app-navigation").classList.toggle("show-navigation")
},
updateFilters: function(e) {
this.filterValue = e
Expand Down
24 changes: 12 additions & 12 deletions src/components/AppIndex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
</template>

<script>
import axios from '@nextcloud/axios'
import LazyPicture from './LazyPicture'
import RecipeKeyword from './RecipeKeyword'

Expand Down Expand Up @@ -196,19 +197,18 @@ export default {
* Load all recipes from the database
*/
loadAll: function () {
var deferred = $.Deferred()
var $this = this
$.get(this.$window.baseUrl + '/api/recipes').done(function (recipes) {
$this.recipes = recipes
deferred.resolve()
// Always set page name last
$this.$store.dispatch('setPage', { page: 'index' })
}).fail(function (jqXHR, textStatus, errorThrown) {
deferred.reject(new Error(jqXHR.responseText))
// Always set page name last
$this.$store.dispatch('setPage', { page: 'index' })
})
return deferred.promise()
axios.get(this.$window.baseUrl + '/api/recipes')
.then(function (response) {
$this.recipes = response.data
$this.setKeywords($this.recipes)
// Always set page name last
$this.$store.dispatch('setPage', { page: 'index' })
})
.catch(function (e) {
// Always set page name last
$this.$store.dispatch('setPage', { page: 'index' })
})
},
},
mounted () {
Expand Down
Loading