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 • committed by Noah Lancien
parent 3dce58d9a0
commit ad00dd2246
5 changed files with 16 additions and 6 deletions

View file

@ -274,6 +274,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

@ -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

@ -529,7 +529,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;
@ -575,7 +575,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;
})