Skip to content

High6 Document Archive #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open

High6 Document Archive #169

wants to merge 33 commits into from

Conversation

it-00
Copy link
Contributor

@it-00 it-00 commented Mar 31, 2025

No description provided.

Copy link
Contributor

@Equasa Equasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ni får nog kolla över detta lite mer men en bra början


file_path: Mapped[str] = mapped_column(String, nullable=False) # Path or URL to the document file
file_type: Mapped[str] = mapped_column(String(50)) # PDF, DOCX, etc.
date_uploaded: Mapped[datetime] = mapped_column(default=datetime.now(timezone.utc))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

konstig datetime grej, kolla hur vi gör vanligtvis, borde också vara init = false

document_router = APIRouter()


""" @document_router.post(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ta bort skräp


""" @document_router.post(
"/", dependencies=[Permission.require("manage", "DocumentArchive")], response_model=DocumentOverview
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ta bort skräp

if len(name) > MAX_DOCUMENT_TITLE:
raise HTTPException(400, detail="The file name is too long")

file_path = Path(f"documents/{datetime.date(datetime.now(timezone.utc))}-{name.replace(' ', '-')}.pdf")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file path känns jobbig

file_path = Path(f"documents/{datetime.date(datetime.now(timezone.utc))}-{name.replace(' ', '-')}.pdf")
if file_path.is_file():
raise HTTPException(400, detail="Filename is equal to already existing file")
if file.size == None or file.size > MAX_DOCUMENT_BYTES:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

måste vara två if statements innanför varandra annars krash

def remove_doc(db: Session, img_id: int):
# img = db.query(Img_DB).filter(Img_DB.id == img_id).one_or_none()

# if img == None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vad händer här?

"/", dependencies=[Permission.require("manage", "DocumentArchive")], response_model=DocumentOverview
)
def update_document(db: DB_dependency, data: DocumentUpdate):
pass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vad händer här?

"/", dependencies=[Permission.require("manage", "DocumentArchive")], status_code=status.HTTP_204_NO_CONTENT
)
def delete_user_access(db: DB_dependency, access_id: int):
return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vad händer här?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants