Skip to content

Commit

Permalink
#71 fix : modify land api params (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
0321minji authored Aug 14, 2024
1 parent 9bc06af commit f17d6ac
Show file tree
Hide file tree
Showing 3 changed files with 257 additions and 117 deletions.
8 changes: 4 additions & 4 deletions lands/selectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ def locations(self, item:Item, user:User):

class LandSelector:
@staticmethod
def get_user_items(user_id):
items = Item.objects.filter(users__id=user_id).prefetch_related('item_image', 'locations')
def get_user_items(user_email):
items = Item.objects.filter(users__email=user_email).prefetch_related('item_image', 'locations')
return items

@staticmethod
def get_user_land(user_id):
land = Land.objects.get(user__id=user_id)
def get_user_land(user_email):
land = Land.objects.get(user__email=user_email)
return land

class LocationSelector:
Expand Down
3 changes: 1 addition & 2 deletions lands/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
app_name = "lands"

urlpatterns=[
path('',LandCreateApi.as_view(),name='create'),
path('',LandApi.as_view(),name='lands'),
path('items/img/',ItemImageCreateApi.as_view(),name='item_img_create'),
path('items/show/',ItemShowUpdateApi.as_view(),name='item_show'),
path('<int:user_id>/',UserLandItemListApi.as_view(),name='lands_items'),
#path('items/',ItemLocationUpdateApi.as_view(),name='item_update'),
path('items/',ItemCreateApi.as_view(),name='item_create'),
path('items/game/',ItemGetApi.as_view(),name='item_get'),
Expand Down
Loading

0 comments on commit f17d6ac

Please sign in to comment.