Skip to content
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

Merged
merged 4 commits into from
Feb 28, 2024
Merged

Fix tours API output [MA-156] #260

merged 4 commits into from
Feb 28, 2024

Conversation

nikhiltri
Copy link
Member

No description provided.

Copy link
Member

@zachgarwood zachgarwood left a 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,
Copy link
Member

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

Copy link
Member Author

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]);
Copy link
Member

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();

Copy link
Member

@zachgarwood zachgarwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌈 🌟

@nikhiltri nikhiltri merged commit 19942b4 into develop Feb 28, 2024
3 checks passed
@nikhiltri nikhiltri deleted the fix/tour-api-output branch February 28, 2024 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants