So this time around, I have a bit of a challenge for you.
It's not terribly difficult, but will give you a bit more experience doing the sorts of things we've
been covering in this section.
So I'm logged into my application right now.
And if I go to the admin menu and choose all sales, it lists all of my sales.
And I just have one in here because I was playing with the database between the last lecture and this
one.
But if you on your application go to all subscriptions, it just displays a kind of placeholder template
that has nothing more than a title and a horizontal rule.
But when I go there, I get a list of all subscriptions and I want you to write the necessary code to
do this sort of thing.
Now, obviously, for both sales and subscriptions, this link doesn't work yet because we haven't covered
that.
But we'll get to that shortly.
In the meantime, I'd like you to write the necessary code to list all subscriptions.
Obviously, you'll have to sell a subscription first to have something to display here.
But this shouldn't be terribly difficult for you.
Obviously, you're going to have to modify the template for all subscriptions to do pretty much the
same thing you do in all sales.
And you'll have to create a new route on the API backend that will return all sales as JSON.
And you'll either have to create a new database function or modify the existing one to return all subscriptions
instead of all sales or all orders.
And if you recall, the way we're determining whether or not something is a subscription is if that
field is underscore recurring is set to one in the database, in the widgets table.
If it's one, it's a plan.
If it's zero, it's a product.
All right.
Give it a whirl.
And in the next lecture, I'll show you how I accomplish that.
Good luck.