Branch lists

This commit is contained in:
simonwt 2026-04-01 23:32:09 +01:00
parent fb1953e953
commit 636564b873
3 changed files with 24 additions and 3 deletions

View file

@ -1 +1,2 @@
from .get import get from .get import get
from .listbyname import listbyname

View file

@ -0,0 +1,9 @@
def listbyname(API, lastEvaluatedKey=None) -> dict:
"""
Fetches a list of branchs from the API by name.
Returns:
dict: The list of comments for the post.
"""
branch_list = API.make_request("GET", "content", f"subwiki", authenticate=True, query_params=lastEvaluatedKey)
return branch_list

View file

@ -58,6 +58,17 @@ def save_response(response):
# print("-----------------------------") # print("-----------------------------")
# feed = API.run_job('post.listbybranch', "music") # feed = API.run_job('post.listbybranch', "music")
# print(feed) # print(feed)
# print("----------------------------z
# branchlist = API.run_job('branch.listbyname')
# print(branchlist)
# print("-----------------------------")
# branchlist = API.run_job('branch.listbyname', {
# 'GSIByName': 'boopscope test',
# 'sk': 'subwiki#boopscope-test',
# 'pk': 'subwiki#boopscope-test',
# 'entity': 'subwiki'
# })
# print(branchlist)
# print("-----------------------------") # print("-----------------------------")
# feed = API.run_job('post.listbyuserprofile', "simon-little") # feed = API.run_job('post.listbyuserprofile', "simon-little")
# print(feed) # print(feed)
@ -145,6 +156,6 @@ from wrappers.post.create_post import create_post
# ) # )
# save_response(API.run_job(**wrapped)) # save_response(API.run_job(**wrapped))
save_response(API.wrapped(create_post( # save_response(API.wrapped(create_post(
"This is a test post created via the create_post wrapper function.", # "This is a test post created via the create_post wrapper function.",
))) # )))