Skip to content

Commit

Permalink
migrate link endpoint (#485)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackiequach authored Dec 19, 2024
1 parent 3b1ee93 commit 55d6160
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from logger import create_log
from .blueprints import (
search, work, works, info, edition, editions, utils, link, opds, collection, collections, citation, fulfill
search, work, works, info, edition, editions, utils, link, links, opds, collection, collections, citation, fulfill
)
from .utils import APIUtils

Expand All @@ -35,6 +35,7 @@ def __init__(self, dbEngine, redisClient):
self.app.register_blueprint(editions)
self.app.register_blueprint(utils)
self.app.register_blueprint(link)
self.app.register_blueprint(links)
self.app.register_blueprint(opds)
self.app.register_blueprint(collection)
self.app.register_blueprint(collections)
Expand Down
2 changes: 1 addition & 1 deletion api/blueprints/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from .drbCollection import collection, collections
from .drbEdition import edition, editions
from .drbInfo import info
from .drbLink import link
from .drbLink import link, links
from .drbOPDS2 import opds
from .drbSearch import search
from .drbUtils import utils
Expand Down
2 changes: 2 additions & 0 deletions api/blueprints/drbLink.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
logger = create_log(__name__)

link = Blueprint('link', __name__, url_prefix='/link')
links = Blueprint('links', __name__, url_prefix='/links')

@link.route('/<link_id>', methods=['GET'])
@links.route('/<link_id>', methods=['GET'])
def get_link(link_id):
logger.info(f'Getting link with id {link_id}')
response_type = 'singleLink'
Expand Down
2 changes: 1 addition & 1 deletion swagger.v4.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
}
}
},
"/link/{id}": {
"/links/{id}": {
"get": {
"tags": ["digital-research-books"],
"summary": "v4 Get Single Link",
Expand Down

0 comments on commit 55d6160

Please sign in to comment.