Reset Media route resolv using uid (besoin métier) vu avec Vincent

This commit is contained in:
Jérémy Munsch 2023-12-15 12:38:17 +01:00
parent ab28dc9257
commit fe2460d87e
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC
6 changed files with 17 additions and 7 deletions

View file

@ -259,6 +259,16 @@ class Media extends Model
// * Laravel Behaviors
/**
* Get the route key for the model.
*
* @return string
*/
public function getRouteKeyName()
{
return 'uid';
}
/**
* Set the base cache tags that will be present
* on all queries.

View file

@ -224,7 +224,7 @@ export default {
} else {
this.$loading.show({ delay: 0 });
axios
.post(`/ajax/media/${this.storeGrabbed[0].id}/duplicate`)
.post(`/ajax/media/${this.storeGrabbed[0].uid}/duplicate`)
.then((response) => {
this.$loading.hide();
if (response.data.status === true) {

View file

@ -58,7 +58,7 @@
</button>
<button
class="float-right mr-10 copyclipboard"
v-clipboard="'https://dam.lesidc.com/media/' + this.storeMedia.id"
v-clipboard="'https://dam.lesidc.com/media/' + this.storeMedia.uid"
title="Copier le lien"
>
<font-awesome-icon icon="link" />
@ -292,7 +292,7 @@ export default {
},
SaveMedia() {
axios
.put(`/ajax/media/${this.storeMedia.id}`, {
.put(`/ajax/media/${this.storeMedia.uid}`, {
media: this.storeMedia,
})
.then((response) => {

View file

@ -519,7 +519,7 @@ export default {
},
SetIdArcadia() {
axios
.post(`/ajax/media/${this.oMedia.id}/set-id-arcadia`)
.post(`/ajax/media/${this.oMedia.uid}/set-id-arcadia`)
.then((response) => {
if (response.data === true) {
this.oMedia.isLocked = true;
@ -565,7 +565,7 @@ export default {
SaveMedia() {
const self = this;
axios
.put(`/ajax/media/${self.oMedia.id}`, self.oMedia)
.put(`/ajax/media/${self.oMedia.uid}`, self.oMedia)
.then((response) => {
self.$loading.hide();
if (response.data.status === true) {

View file

@ -58,7 +58,7 @@ export default {
) {
const _this2 = this;
axios
.post(`/ajax/media/${this.storeMedia.id}/get-media-others-infos`)
.post(`/ajax/media/${this.storeMedia.uid}/get-media-others-infos`)
.then((response) => {
_this2.history = response.data.history;
})

View file

@ -79,7 +79,7 @@ export default {
) {
const _this2 = this;
axios
.post(`/ajax/media/${this.storeMedia.id}/get-media-others-infos`)
.post(`/ajax/media/${this.storeMedia.uid}/get-media-others-infos`)
.then((response) => {
_this2.links = response.data.vignettes;
})