mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-11-04 03:17:00 -05:00 
			
		
		
		
	Update libraries reorder and get all authors routes
This commit is contained in:
		
							parent
							
								
									eede2bbd46
								
							
						
					
					
						commit
						3c0fdff7b4
					
				@ -82,10 +82,10 @@ export default {
 | 
				
			|||||||
      })
 | 
					      })
 | 
				
			||||||
      var newOrder = libraryOrderData.map((lib) => lib.id).join(',')
 | 
					      var newOrder = libraryOrderData.map((lib) => lib.id).join(',')
 | 
				
			||||||
      if (currOrder !== newOrder) {
 | 
					      if (currOrder !== newOrder) {
 | 
				
			||||||
        this.$axios.$post('/api/libraries/order', libraryOrderData).then((libraries) => {
 | 
					        this.$axios.$post('/api/libraries/order', libraryOrderData).then((response) => {
 | 
				
			||||||
          if (libraries && libraries.length) {
 | 
					          if (response.libraries && response.libraries.length) {
 | 
				
			||||||
            this.$toast.success('Library order saved', { timeout: 1500 })
 | 
					            this.$toast.success('Library order saved', { timeout: 1500 })
 | 
				
			||||||
            this.$store.commit('libraries/set', libraries)
 | 
					            this.$store.commit('libraries/set', response.libraries)
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
				
			|||||||
@ -48,10 +48,13 @@ export default {
 | 
				
			|||||||
  },
 | 
					  },
 | 
				
			||||||
  methods: {
 | 
					  methods: {
 | 
				
			||||||
    async init() {
 | 
					    async init() {
 | 
				
			||||||
      this.authors = await this.$axios.$get(`/api/libraries/${this.currentLibraryId}/authors`).catch((error) => {
 | 
					      this.authors = await this.$axios
 | 
				
			||||||
        console.error('Failed to load authors', error)
 | 
					        .$get(`/api/libraries/${this.currentLibraryId}/authors`)
 | 
				
			||||||
        return []
 | 
					        .then((response) => response.authors)
 | 
				
			||||||
      })
 | 
					        .catch((error) => {
 | 
				
			||||||
 | 
					          console.error('Failed to load authors', error)
 | 
				
			||||||
 | 
					          return []
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
      this.loading = false
 | 
					      this.loading = false
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    authorAdded(author) {
 | 
					    authorAdded(author) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user