I am having hard time understanding why "Wohnung" was made an indirect object instead of a direct object in that sentence. I saw this on Dw German.
Dativ should be used in this case, because the word 'Wohnung' is after a preposition. Some prepositions require a specific case, e.g. mit + Dativ or wegen + Genetiv. Other predispositions can be followed by both Akkusativ or Dativ, so called Wechselpräpositionen. Normally, if the verb is associated with a movement, you'd use Akkusativ after the preposition (e.g. after laufen, gehen) and if the verb is not associated with a movement, like in this sentence - Dativ.