Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Письменов Дмитрий Иванович
/
yourroomads
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit fcad6cb7
authored
May 17, 2021
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#19461 Страница настройки целевых аккаунтов. (fix update edit)
1 parent
3ade173c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
app/Http/Controllers/TokensController.php
app/Models/Dictionary.php
resources/js/Pages/Tokens/CitySettings.vue
app/Http/Controllers/TokensController.php
View file @
fcad6cb
...
...
@@ -153,7 +153,7 @@ class TokensController extends Controller
return
Redirect
::
back
();
}
$
city
->
token
()
->
associate
(
$token
->
getKey
()
);
$
token
->
cities
()
->
save
(
$city
);
return
Redirect
::
route
(
'token.edit'
,
$token
->
getKey
())
->
with
(
'success'
,
'City added.'
);
}
...
...
@@ -164,14 +164,15 @@ class TokensController extends Controller
return
Redirect
::
back
();
}
$city
=
$token
->
cities
()
->
find
(
$city
);
$city
=
$token
->
cities
()
->
where
(
$city
->
getKeyName
(),
$city
->
getKey
())
->
first
();
if
(
!
$city
)
{
return
Redirect
::
back
();
}
$city
->
update
([
'update
d
'
=>
!!
request
(
'updated'
),
'update'
=>
!!
request
(
'updated'
),
]);
return
Redirect
::
route
(
'token.edit'
,
$token
->
getKey
())
->
with
(
'success'
,
'City updated.'
);
...
...
app/Models/Dictionary.php
View file @
fcad6cb
...
...
@@ -8,6 +8,10 @@ class Dictionary extends Model
{
CONST
CITY
=
'City'
;
protected
$fillable
=
[
'update'
,
];
protected
$casts
=
[
'update'
=>
'boolean'
,
];
...
...
resources/js/Pages/Tokens/CitySettings.vue
View file @
fcad6cb
...
...
@@ -32,8 +32,8 @@
<span
class=
"px-6 py-4 flex items-center focus:text-indigo-500"
>
{{
city
.
name
}}
</span>
</td>
<td
class=
"border-t"
>
<input
:checked=
"city.
pivot.updated
"
@
change=
"cityUpdated(city.id, !city.
pivot.updated
)"
<input
:checked=
"city.
update
"
@
change=
"cityUpdated(city.id, !city.
update
)"
type=
"checkbox"
>
</td>
...
...
@@ -106,7 +106,6 @@ export default {
this
.
$emit
(
'delete'
,
id
)
},
cityUpdated
(
id
,
updated
)
{
console
.
log
(
this
.
token_cities
);
this
.
$emit
(
'updated'
,
id
,
updated
)
},
campaignUpdated
(
id
,
updated
)
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment