That’ll certainly do it, but I think I would have used bed bolts or threaded inserts or a wedged mortise and tenon.

Show us the final product when you’re done.