Compare commits

..

2 commits

Author SHA1 Message Date
Elia el Lazkani
35c8dfd21a enh(): Adds configurable CORS
* Adds CORS configuration in the config file
* Enables CORS to be toggled through config
2024-12-24 00:38:37 +00:00
Elia el Lazkani
c036d042c3 fix(): Adds the pointer to the session before proceeding 2024-12-24 01:35:37 +01:00

View file

@ -65,9 +65,9 @@ def shorten_it(config: dict, session: Session, data: str, ttl: int):
_link = Link(data=data, pointers=[])
_pointer = Pointer(data=identifier, link_id=_link.id, link=_link, ttl=ttl)
session.add(_pointer)
_link.pointers.append(_pointer)
session.add(_link)
session.add(_pointer)
session.commit()
return _pointer.data
return None