-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix tours API output [MA-156] #260
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One needed change and one suggested change
@@ -10,7 +10,7 @@ class StopTransformer extends TransformerAbstract | |||
public function transform(TwillModelContract $stop): array | |||
{ | |||
return [ | |||
'object' => "$stop->object_type:$stop->object_id", | |||
'object' => class_basename($stop->selector?->object::class) . ':' . $stop->object_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll also need to update the ObjectTransformer
, which currently lowercases the class name:
https://github.com/art-institute-of-chicago/aic-mobile-cms/blob/develop/app/Models/Transformers/ObjectTransformer.php#L21
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good to know. I'll update this PR to match what the ObjectTransformer
is already doing.
{ | ||
public function up(): void | ||
{ | ||
LoanObject::query()->update(['is_on_view' => 1]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should also set the default for the is_on_view
column to true:
$table->boolean('is_on_view')->default(true)->change();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🌈 🌟
No description provided.